Skip to content

Dockerfile build approach doesn't ensure consistent openssl lib at runtime #178

Closed
@j-m-harris

Description

@j-m-harris

This problem has been discovered while investigating:

The build approach at https://github.com/cloudamqp/amqproxy/blob/main/Dockerfile results in a dynamically linked amqpproxy, but does not ensure the same library version is used at runtime compared to compile time.

It might be the case they match, as https://github.com/84codes/crystal-container-images/blob/main/alpine/Dockerfile defaults to alpine:latest as well, but it depends on when the builds are run.

Not using the same version at runtime can lead to illegal instruction errors as noted in issue #174 , when using TLS for an upstream host.

For example in our build environment right now:

  • Builder image:
    • libcrypto3-3.3.1-r3 x86_64 {openssl} (Apache-2.0) [installed]
    • libssl3-3.3.1-r3 x86_64 {openssl} (Apache-2.0) [installed]
  • Runtime image:
    • libcrypto3-3.3.2-r0 x86_64 {openssl} (Apache-2.0) [installed]
    • libssl3-3.3.2-r0 x86_64 {openssl} (Apache-2.0) [installed]

Workarounds

  • Use shard build --static for amqproxy.
  • Copy libssl/libcrypto from the builder image to the runtime image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions