Coder Social home page Coder Social logo

Issues building docker image about gcs-helper HOT 2 OPEN

nytimes avatar nytimes commented on August 24, 2024
Issues building docker image

from gcs-helper.

Comments (2)

Clee681 avatar Clee681 commented on August 24, 2024

@jdavey That error seems to be due to system arch differences from compiling the executable on MacOS but trying to run in Linux env.

Interestingly, if I try building the executable on Debian, and try to run the Dockerfile I get a different error.

$ docker run --rm -it gcs-helper:local
standard_init_linux.go:211: exec user process caused "no such file or directory"

I see the gcs-helper executable in the /usr/bin directory, but it does not run.

/ # gcs-helper
/bin/sh: gcs-helper: not found
/ # ls -lah /usr/bin/ | grep gcs
-rwxr-xr-x    1 root     root       15.5M Apr 10 20:00 gcs-helper
/ # echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

But, if I run the same executable inside the golang:1.14.2-stretch image, it works.

It seems like the base alpine image is missing some shared object file dependencies.

golang:1.14.2-stretch

root@3a1137bfd01f:/usr/src/app# ldd gcs-helper
        linux-vdso.so.1 (0x00007ffe539f9000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb8dd4f2000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb8dd153000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb8dd70f000)

alpine:3.11.3

/usr/bin # ldd ./gcs-helper
        /lib64/ld-linux-x86-64.so.2 (0x7f80df921000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f80df921000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f80df921000)

from gcs-helper.

Clee681 avatar Clee681 commented on August 24, 2024

Update: I was able to fix the alpine image by symlinking the musl library to the location that the linker wants.

mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

musl bundles shared libraries in a single file including libpthread, so creating the symlink for /lib/libc.musl-x86_64.so.1 is all that was needed.

from gcs-helper.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.