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

alpine images are not yet functional #5768

Closed
timmyers opened this issue May 6, 2020 · 8 comments · Fixed by #5777 or #7883
Closed

alpine images are not yet functional #5768

timmyers opened this issue May 6, 2020 · 8 comments · Fixed by #5777 or #7883
Assignees
Labels
Bug Something isn't working CI Continuous integration related items

Comments

@timmyers
Copy link
Contributor

timmyers commented May 6, 2020

🐞 Bug Report

Description

*-alpine tag images are not yet functional, with error libstdc++.so.6: cannot open shared object file: No such file or directory

Has this worked before in a previous version?

No

🔬 Minimal Reproduction

❯ docker run -it --rm gcr.io/prysmaticlabs/prysm/beacon-chain:latest-alpine
/app/beacon-chain/image.binary: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

🔥 Error

See above

🌍 Your Environment

Any docker environment.

@farazdagi farazdagi added Bug Something isn't working CI Continuous integration related items labels May 7, 2020
@prestonvanloon prestonvanloon self-assigned this May 7, 2020
@prestonvanloon
Copy link
Member

prylabs-bulldozer bot pushed a commit that referenced this issue May 7, 2020
* fix #5768 with an alpine base including libstdc++
* Merge branch 'master' into fix-docker-alpine
@prestonvanloon prestonvanloon reopened this May 9, 2020
@prestonvanloon
Copy link
Member

prestonvanloon commented May 9, 2020

User reported alpine images are still not functional.

cc: @eduadiez

@rauljordan
Copy link
Contributor

@timmyers this issue has likely gone stale. Can you try our latest alpine images and let us know if you run into any issues? if so, we can reopen

@nisdas
Copy link
Member

nisdas commented Sep 20, 2020

Reopening this issue as it has been reported that alpine images are still not functional

@protolambda
Copy link

Which libraries in prysm require native dependencies? Previously I went through Herumi BLS to get it to run on alpine linux, see:

Maybe that's broken here? Or maybe there is a similar problem with another library?

@prestonvanloon
Copy link
Member

This is what happens when I tried to run alpine:

Unable to find image 'gcr.io/prysmaticlabs/prysm/beacon-chain:latest-alpine' locally
latest-alpine: Pulling from prysmaticlabs/prysm/beacon-chain
169185f82c45: Pull complete 
3ac0fa0cb1ae: Pull complete 
c5a366754cd7: Pull complete 
91e8ba83d9d4: Pull complete 
Digest: sha256:6165bb335d267a7c2dd76a2620ed9e13c919c7db23190370df8f3c7e7dd9eab1
Status: Downloaded newer image for gcr.io/prysmaticlabs/prysm/beacon-chain:latest-alpine
standard_init_linux.go:211: exec user process caused "no such file or directory"

@pinglamb
Copy link
Contributor

Is the issue related to dynamic linking described here: https://stackoverflow.com/questions/36279253/go-compiled-binary-wont-run-in-an-alpine-docker-container-on-ubuntu-host

It seems to be able to build an alpine image using this command (with the flags suggested in the post):

bazelisk run --config=docker-sandbox --features=static --features=pure //beacon-chain:image --//tools:base_image=alpine

@pinglamb
Copy link
Contributor

As discussed in Discord, this project probably cannot be built with --features=static --features=pure.

Further investigation shows that the binary built has dynamic dependencies like this:

# ldd beacon-chain
    /lib64/ld-linux-x86-64.so.2 (0x7fe725e2b000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7fe725e2b000)
    libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fe725e2b000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fe725e2b000)

and the Alpine needs to have libc6-compat installed so the dymanic linking will work (which seems to be a symlink to /lib/libc.musl-x86_64.so.1).

The alpine base image Dockerfile:

FROM alpine:3.12
RUN apk update && apk add --no-cache libc6-compat

This resolve the standard_init_linux.go:211: exec user process caused "no such file or directory" and the container will be able to start, but I am not sure if musl provides enough functionalities for the binaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working CI Continuous integration related items
Projects
None yet
7 participants