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 Image not Working #33

Closed
mohammed90 opened this issue Nov 5, 2019 · 3 comments
Closed

Docker Image not Working #33

mohammed90 opened this issue Nov 5, 2019 · 3 comments

Comments

@mohammed90
Copy link
Collaborator

Okay, so this is a multifaceted issue, and not limited to just the Docker image. The Docker image is how I found it.

Simple go build doesn't work because of the presence of the webdav/ directory while the module name is also webdav. The go build command will complain with go build: build output "webdav" already exists and is a directory. The go build command can be fooled into proceeding with the build by issuing go build -o webdav main.go, at which it'll (hilariously) create the binary inside the webdav directory as such webdav/command-line-arguments. Yes, the binary name is command-line-arguments. This wasn't an issue before c5f3907 because back then the main package was within a directory named webdav, so there was no name conflict.

Now Docker... the Dockerfile. So the Dockerfile copies the webdav to /webdav, which we now know is a directory and not a binary.

COPY webdav /webdav

Then it tries to execute it:

ENTRYPOINT [ "/webdav" ]

which causes Docker to log standard_init_linux.go:211: exec user process caused "no such file or directory". That's because it's trying to execute a directory.

@hacdias
Copy link
Owner

hacdias commented Nov 10, 2019

Will release v3 now with this fix.

@hacdias hacdias closed this as completed Nov 10, 2019
@facewy
Copy link

facewy commented Aug 25, 2020

release v3: Docker Image still not Working
docker run -d --name webdav hacdias/webdav:v3.0.0
standard_init_linux.go:211: exec user process caused "no such file or directory"

@mohammed90
Copy link
Collaborator Author

The dependecies are not added in the docker image, that is why there is "no such file or directory" error.
Need to add "libpthread.so.0", "libc.so.6", "ld-linux-x86-64.so.2" to /lib64, and the file can run.
Suggest @hacdias add that.

Not exactly. The binary was being compiled with dynamic link to libc which calls those libs. We've already resolved that by building the binary statically by disabling cgo.

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

No branches or pull requests

3 participants