Upgrade internal Debian image

I’ve create a simple tftp docker from Debian Bookworm.

First run is:

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

I would like to periodically upgrade and build image.

It works if i launch build command? If there are no changes to the Dockerfile, are the cached layers used and then also the layer created by the first RUN is skipped?

Or simply works if i launch:

docker-compose down && docker-compose up -d

?

Thanks to all and I hope I’ve been able to explain!! :slight_smile:

If the image exists, docker compose up will not attempt to rebuild, unless you specify --build

You may want to look at watch, which rebuilds whenever a file the image depends on (like your code or dockerfile itself) changes

Also, use docker compose, not docker-compose