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

Unable to build docker image on linux #207

Closed
alexdavid opened this issue Jun 12, 2019 · 2 comments
Closed

Unable to build docker image on linux #207

alexdavid opened this issue Jun 12, 2019 · 2 comments

Comments

@alexdavid
Copy link
Contributor

alexdavid commented Jun 12, 2019

Describe the bug

ec40cc4 replaces a portable statically linked docker-based build with instructions to build on a local machine. The problem is the resulting binary that is added to the docker image is dynamically linked, (at least on linux, macos might not have the libraries so go includes them in the binary).

Reproducing the bug

$ GO111MODULE=on GOOS=linux GOARCH=amd64 go build
$ file oathkeeper
oathkeeper: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
$ ldd oathkeeper
	linux-vdso.so.1 (0x00007ffca5967000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f10fa6e6000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f10fa521000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f10fa72d000)
$ docker build -t oryd/oathkeeper .
# ...docker output ...
$ docker run -it oryd/oathkeeper:latest
standard_init_linux.go:211: exec user process caused "no such file or directory"

The problem is since the binary is dynamically linked and FROM scratch does not have the required .so files docker returns a cryptic error message.

Expected behavior

Developers are able to build oathkeeper on any platform and the resulting docker image runs

Environment

  • 1e03ee2
  • Archlinux
  • go version go1.12.5 linux/amd64
  • docker version 18.09.6-ce linux/amd64

Fix
git checkout ec40cc4cfa1716adff9cb4cd8c604aa6f4aa9e91^ Dockerfile fixes the issue. Would you consider reverting that commit?

@aeneasr
Copy link
Member

aeneasr commented Jun 12, 2019 via email

@alexdavid
Copy link
Contributor Author

Ah, makes sense. I was thrown off by the instructions at the top of the Dockerfile.

Thanks!

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

2 participants