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

WIP: Initial separate builder/runner images #138

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

Conversation

jmtd
Copy link
Contributor

@jmtd jmtd commented Jul 7, 2021

Define a new container, striot/striot-runtime, intended to be used as
the basis for runtime containers. Based on Debian 10 slim (aka Buster,
the current stable version at the time of writing) with the additional
librdkafka1 installed.

Adjust the Dockerfile-generation code to use a multi-stage build, where
the build takes place in striot/striot-base, and the resulting "node"
binary copied over to a new container based on the runtime.

The resulting images are much smaller: striot/striot-base is 3.15GB
right now, and striot/striot-runtime would be about 93.5MB. The binaries
we build are typically around 50M, but could be reduced to about 33M if
we strip the debug symbols out.

striot-base is based on haskell:8.6, which is based on Debian "Stretch"
("oldstable", the release before the current stable). There could be ABI
incompatibilities between libc or librdkafka1 in the builder and runner
containers. We should harmonize on a common base version; possibly the
/next/ Debian stable release (bullseye), which is due very soon, once
there are hub.docker.com/_/haskell containers based on it. I've marked
this "WIP" for that reason. (We might also need to look at GHC version.
I think 8.6 is already "unsupported" in the containers)

Another reason this is WIP: it will break the Taxi example, since node1
requires "sorteddata.csv" in the container.
debian:stretch

Define a new container, striot/striot-runtime, intended to be used as
the basis for runtime containers. Based on Debian 10 slim (aka Buster,
the current stable version at the time of writing) with the additional
librdkafka1 installed.

Adjust the Dockerfile-generation code to use a multi-stage build, where
the build takes place in striot/striot-base, and the resulting "node"
binary copied over to a new container based on the runtime.

The resulting images are much smaller: striot/striot-base is 3.15GB
right now, and striot/striot-runtime would be about 93.5MB. The binaries
we build are typically around 50M, but could be reduced to about 33M if
we strip the debug symbols out.

striot-base is based on haskell:8.6, which is based on Debian "Stretch"
("oldstable", the release before the current stable). There could be ABI
incompatibilities between libc or librdkafka1 in the builder and runner
containers. We should harmonize on a common base version; possibly the
/next/ Debian stable release (bullseye), which is due very soon, once
there are hub.docker.com/_/haskell containers based on it. I've marked
this "WIP" for that reason. (We might also need to look at GHC version.
I think 8.6 is already "unsupported" in the containers)

Another reason this is WIP: it will break the Taxi example, since node1
requires "sorteddata.csv" in the container.
debian:stretch
@jmtd
Copy link
Contributor Author

jmtd commented Mar 20, 2024

The official Haskell docker images are lagging quite far behind Debian stable releases. At the time of writing, the latest release is built on Debian Buster (version 10, aka oldoldstable). Current version is 12 (bookworm). haskell/docker-haskell#88 Is an unmerged draft PR to move to version 11.

Latest news seems to be that this is still blocked haskell/docker-haskell#73 (comment)

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

Successfully merging this pull request may close these issues.

1 participant