Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Build Process is Difficult/Doesn't Work Properly #44

Open
festanie opened this issue Apr 13, 2018 · 10 comments
Open

Docker Build Process is Difficult/Doesn't Work Properly #44

festanie opened this issue Apr 13, 2018 · 10 comments
Assignees
Labels

Comments

@festanie
Copy link

I got a few error when trying to build the docker images.

First, if I simply run make build I got the following:
docker run --rm --net=host -e USER_ID=1000
-v /home/oper/code/golang/src/github.com/fireeye/gocrack/docker/dist/hashcat:/out
gocrack/hashcat_shared
install -m 755 -d /out/share/doc/hashcat
install -m 755 -d /out/share/hashcat
gcc -c -pipe -std=gnu99 -Iinclude/ -Iinclude/lzma_sdk/ -IOpenCL/ -O2 -Ideps/OpenCL-Headers/ -DWITH_HWMON src/affinity.c -o obj/affinity.NATIVE.SHARED.o -fpic
gcc -c -pipe -std=gnu99 -Iinclude/ -Iinclude/lzma_sdk/ -IOpenCL/ -O2 -Ideps/OpenCL-Headers/ -DWITH_HWMON src/autotune.c -o obj/autotune.NATIVE.SHARED.o -fpic
gcc -c -pipe -std=gnu99 -Iinclude/ -Iinclude/lzma_sdk/ -IOpenCL/ -O2 -Ideps/OpenCL-Headers/ -DWITH_HWMON src/benchmark.c -o obj/benchmark.NATIVE.SHARED.o -fpic
gcc -c -pipe -std=gnu99 -Iinclude/ -Iinclude/lzma_sdk/ -IOpenCL/ -O2 -Ideps/OpenCL-Headers/ -DWITH_HWMON src/bitmap.c -o obj/bitmap.NATIVE.SHARED.o -fpic
install: cannot create directory '/out/share': Permission denied
install: cannot create directory '/out/share': Permission denied
src/Makefile:328: recipe for target 'install_docs' failed
make: *** [install_docs] Error 1
make: *** Waiting for unfinished jobs....
make: *** [install_shared] Error 1
src/Makefile:358: recipe for target 'install_shared' failed
Makefile:19: recipe for target 'hashcat' failed
make: *** [hashcat] Error 2

So there is a problem in the run of the hashcat docker container.

I then tried to run the same thing using sudo. This time, the hashcat part of the make build works, but in the gocrack one, I get the following error:
docker run --rm --net=host -e USER_ID=0
-v /home/oper/code/golang/src/github.com/fireeye/gocrack/docker/dist/gocrack:/out
-v /src/github.com/fireeye/gocrack:/go/src/github.com/fireeye/gocrack
gocrack/build
make: *** No targets specified and no makefile found. Stop.
Makefile:31: recipe for target 'gocrack' failed
make: *** [gocrack] Error 2

I then tried to make the different target seperately:
sudo make hashcat
make gocrack

I get a permission denied error after the make gocrack:
mkdir: cannot create directory ‘/home/oper/code/golang/src/github.com/fireeye/gocrack/docker/dist/gocrack’: Permission denied
Makefile:31: recipe for target 'gocrack' failed
make: *** [gocrack] Error 1

So I change the permissions of the dist directory and tried again make gocrack.
The docker build command works but the docker run fails:
docker run --rm --net=host -e USER_ID=1000
-v /home/oper/code/golang/src/github.com/fireeye/gocrack/docker/dist/gocrack:/out
-v /home/oper/code/golang/src/github.com/fireeye/gocrack:/go/src/github.com/fireeye/gocrack
gocrack/build
mkdir -p builds/
go build -tags """" -o /out/gocrack_worker -ldflags
"-X github.com/fireeye/gocrack/worker.CompileRev=dc14ad5
-X github.com/fireeye/gocrack/worker.CompileTime=1523610442
-X github.com/fireeye/gocrack/worker/engines/hashcat.HashcatVersion=v3.6.0"
cmd/gocrack_worker/.go
go: disabling cache (/home/build/.cache/go-build) due to initialization failure: mkdir /home/build: permission denied
go build -tags """" -o /out/gocrack_server -ldflags
"-X github.com/fireeye/gocrack/server.CompileRev=dc14ad5
-X github.com/fireeye/gocrack/server.CompileTime=1523610442"
cmd/gocrack_server/
.go
go: disabling cache (/home/build/.cache/go-build) due to initialization failure: mkdir /home/build: permission denied

I modified the file Dockerfile.build.ubuntu in order to add --create-home to RUN useradd --non-unique --uid $USER_ID build and now make gocrack works properly.

@I-Iugo
Copy link

I-Iugo commented May 17, 2018

@festanie it works for you?

@festanie
Copy link
Author

The builds worked but then I didn't manage to understand how to configure everything and I stopped there because of alack of time.

@I-Iugo
Copy link

I-Iugo commented May 28, 2018

Ok thanks, I was able to configure and launch. But I had to customize worker Dockerfile with this

@tankbusta
Copy link
Contributor

Sorry for the docker problems... It's just me on this project within the Company and I've had other duties in between this release and now. Q3 (starting monday) I should have some time to fix a lot of these pains when dealing with docker so stay tuned.

@tankbusta tankbusta added the bug label Jun 29, 2018
@tankbusta tankbusta changed the title Docker build issues Docker Build Process is Difficult/Doesn't Work Properly Jun 29, 2018
@tankbusta tankbusta self-assigned this Jun 29, 2018
@huwilerp
Copy link

huwilerp commented Jul 2, 2018

Tankbusta,

I've attempted to try all the steps, and still not able to successfully run (Make gocrack). Any thoughts, oh give me an address send you a case of beer.

Removing intermediate container 77f80ec9108f
Successfully built 1dbe4079b4ad
docker run --rm --net=host -e USER_ID=0
-v /home/repo/src/github.com/fireeye/gocrack/docker/dist/gocrack:/out
-v /src/github.com/fireeye/gocrack:/go/src/github.com/fireeye/gocrack
gocrack/build
make: *** No targets specified and no makefile found. Stop.
Makefile:31: recipe for target 'gocrack' failed
make: *** [gocrack] Error 2

@rsj123
Copy link

rsj123 commented Jul 11, 2018

@huwilerp yeah,i met the same problem. It seems a bug.

@huwilerp
Copy link

@tankbusta Hey Brother, I know you are busy and your're doing a awesome job with this project.. Just curious if you could throw some ideas out to get this running... Should I pull a previous version?

@0xIn7rud3r
Copy link

@huwilerp Looks like you haven't set Golang Paths. Also use "go get". Also Referenced here #43

install go and setup path

export GOROOT=$HOME/go1.X
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/go
go get github.com/fireeye/gocrack
cd ~/go/src/github.com/fireeye/gocrack/docker
make build

@rsj123
Copy link

rsj123 commented Aug 13, 2018

@0xIn7rud3r I tired this way,but it semms not helpful,it still doesn't work.

@MonkeyCst
Copy link

@rsj123 Hi dude, I'm facing the same problem right now, did you find any solution back in a day ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants