-
Notifications
You must be signed in to change notification settings - Fork 9
Description
During discussion in #21, I ran lsupg on utdemir/ghc-musl:v24-ghc922 and was surprised to see that many packages have updates for an image that was built so recently. I assume that ghc-musl containers are not public-facing, but statically linking old versions of libraries could have security implications for the static executables built using ghc-musl.
The image that I am testing was built within the past two days.
$ docker images utdemir/ghc-musl
REPOSITORY TAG IMAGE ID CREATED SIZE
utdemir/ghc-musl v24-ghc884 762d6c408038 About an hour ago 3.38GB
utdemir/ghc-musl v24-ghc922 e4b4c874e807 40 hours ago 3.71GB
utdemir/ghc-musl v24-ghc8107 bf3cac041a70 41 hours ago 3.42GB
utdemir/ghc-musl v24-ghc902 f7e76a7f3474 41 hours ago 3.32GB
There are a number of packages with updates available. In this case, ghc-musl users may be concerned with the old crypto, TLS, and SSL packages.
$ lsupg --docker utdemir/ghc-musl:v24-ghc922
apk busybox 1.34.1-r3 1.34.1-r4
apk ca-certificates-bundle 20191127-r7 20211220-r0
apk libcrypto1.1 1.1.1l-r8 1.1.1n-r0
apk libssl1.1 1.1.1l-r8 1.1.1n-r0
apk libretls 3.3.4-r2 3.3.4-r3
apk ssl_client 1.34.1-r3 1.34.1-r4
apk bash 5.1.8-r0 5.1.16-r0
apk expat 2.4.4-r0 2.4.7-r0
apk openssl-dev 1.1.1l-r8 1.1.1n-r0
apk openssl-libs-static 1.1.1l-r8 1.1.1n-r0
apk libxml2 2.9.12-r2 2.9.13-r0
The problem is that apk update is run to update the package index, but apk upgrade is not run to upgrade the packages that are already installed. The parent image (alpine:3.15.0) is over four months old, so the packages really should be upgraded, IMHO.
Using a specific version (3.15.0) of the alpine image makes it clear exactly which image was used to build a ghc-musl image. Adding apk upgrade, however, means that the packages used depends on the timing of the build. Perhaps this negates the point of using a specific version? Would it be worthwhile to use alpine:latest instead? Note that I recommend running apk upgrade even when using the latest image.