use cgr.dev/chainguard/wolfi-base#92
Conversation
We compile Lua with ubuntu, then copy it across to a much smaller image based on cgr.dev/chainguard/wolfi-base 552MB becomes 44.1MB
| apt-get purge --auto-remove && \ | ||
| apt-get clean | ||
| apt-get install -y curl gcc make unzip gnupg && \ | ||
| rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
Do you need the rm if the layer gets dropped?
| FROM cgr.dev/chainguard/wolfi-base | ||
|
|
||
| # Wolfi is glibc-based, so the Lua interpreter and busted's compiled | ||
| # C extensions built above run against Wolfi's glibc unmodified. |
There was a problem hiding this comment.
Does this require the glibc versions match?
Can lua be compiled with static library linking so you're not depending on the host library?
There was a problem hiding this comment.
The builder glibc must not be newer than the runtime glibc.
Now using the same wolfi in the builder, so that possibility (if we updated the builder to a newer ubuntu) goes away.
|
Would it make sense to compile lua directly on wolfi or does wolfi lack the needed dependencies? |
| git clone https://github.com/exercism/lua track | ||
| if [ "$1" != "--skip-clone" ]; then | ||
| rm -rf track | ||
| git clone https://github.com/exercism/lua track |
There was a problem hiding this comment.
| git clone https://github.com/exercism/lua track | |
| git clone --depth 1 https://github.com/exercism/lua track |
Will be a little quicker, assuming you don't need all the history.
Done. I don't understand why, but we now have 54.7MB instead of 44.1MB |
We compile Lua with ubuntu, then copy it
across to a much smaller image based on
cgr.dev/chainguard/wolfi-base
552MB becomes 54.7MB
(95 MB with git - was needed by run-integration-tests)