-
Notifications
You must be signed in to change notification settings - Fork 360
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
Comments
Use „make docker“ :) It happens because CGO is enabled.
… On 12. Jun 2019, at 20:11, Alex David ***@***.***> wrote:
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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ah, makes sense. I was thrown off by the instructions at the top of the Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
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
Fix
git checkout ec40cc4cfa1716adff9cb4cd8c604aa6f4aa9e91^ Dockerfile
fixes the issue. Would you consider reverting that commit?The text was updated successfully, but these errors were encountered: