-
Notifications
You must be signed in to change notification settings - Fork 240
Description
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.