Pattern: Use of apk upgrade
Issue: -
You should avoid RUN apk upgrade
as many of the “essential” packages from the parent images won’t upgrade inside an unprivileged container. If a package contained in the parent image is out-of-date, you should contact its maintainers. If you know there’s a particular package, foo
, that needs to be updated, use apt-get install -y foo
to update automatically.
Example of incorrect code:
RUN apk update \
&& apk upgrade \
&& apk add curl
Example of correct code:
RUN apt-get update && apt-get install -y curl