Menu

Our nightly patch build reused one cached apt-get upgrade for seven months
📰

Our nightly patch build reused one cached apt-get upgrade for seven months

DEV Community: cicd·Sergey Shinder·9 days ago
#OohFfzRU
#devtocicd#devto#dev#night#cache
Reading 0:00
15s threshold

Our services run on a base image of our own, built from Ubuntu 22.04. In March we pinned the Ubuntu image by digest, so that two builds of the same commit would always start from the same bytes, and we kept security patches flowing with one line near the top of the Dockerfile:

RUN apt-get update && apt-get -y upgrade && rm -rf /var/lib/apt/lists/*

A scheduled workflow rebuilt the base image every night and pushed it, and every service picked it up on its next build. The workflow uses buildx with a registry cache, cache-from and cache-to pointing at the same reference, to keep builds fast.

In October an external penetration test reported that our customer API was running an OpenSSL with a fix published in the summer. We said that was impossible, because the image had been rebuilt the night before. Its creation date agreed with us.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.