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

Change the build to use static libraries #180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrmason
Copy link

@mrmason mrmason commented Oct 7, 2024

Changes the build process to use static libraries. This does make the docker image bigger, but stops any library mismatches coming from using different alpine:latest images in chained docker images.

Fixes #178
Fixes #174

@dentarg
Copy link
Member

dentarg commented Oct 7, 2024

It use to be static but then it was changed with 2e54b76

The Docker images we publish are built with --static (https://github.com/search?q=repo%3Acloudamqp%2Famqproxy%20static&type=code) but you aren't using them?

Copy link
Member

@dentarg dentarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the simplest solution? :) I will let others merge this if they are OK with it

@mrmason
Copy link
Author

mrmason commented Oct 7, 2024

It use to be static but then it was changed with 2e54b76

The Docker images we publish are built with --static (https://github.com/search?q=repo%3Acloudamqp%2Famqproxy%20static&type=code) but you aren't using them?

Unless I'm mistaken, that search shows that the tarball is built static, not the docker image? I was assuming that the Dockerfile in the root was what would be used to produce the docker images on dockerhub. Those are the images we are using, and the ones we've seen the bugs reported in this PR.

I can see the previous commit that removes the static, and I've shown in #178 that this does indeed increase the image size - however this is from 11MB to 32MB - so I don't see it as a problem for most workloads.

I would suggest that if the aim is to get a super small image, then all of the docker images need to be version pinned throughout the build process.

@j-m-harris
Copy link
Contributor

The Docker images we publish are built with --static (https://github.com/search?q=repo%3Acloudamqp%2Famqproxy%20static&type=code) but you aren't using them?

Perhaps I'm missing something, but they don't appear to be:

$ docker pull cloudamqp/amqproxy:v2.0.2
$ docker run -it --entrypoint /bin/sh  cloudamqp/amqproxy:v2.0.2
/ $ ldd /usr/bin/amqproxy 
        /lib/ld-musl-x86_64.so.1 (0x7e93e6db1000)
        libssl.so.3 => /lib/libssl.so.3 (0x7e93e6a77000)
        libcrypto.so.3 => /lib/libcrypto.so.3 (0x7e93e662f000)
        libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x7e93e6584000)
        libevent-2.1.so.7 => /usr/lib/libevent-2.1.so.7 (0x7e93e653a000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7e93e6516000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7e93e6db1000)

@dentarg
Copy link
Member

dentarg commented Oct 7, 2024

Sorry I got that wrong. Thanks for checking.

@j-m-harris
Copy link
Contributor

Sorry I got that wrong. Thanks for checking.

Np, appreciate you taking a look at all!

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