

Not installing suggested or recommended dependencies I used the Ubuntu 22.04 LTS Docker image as the base for this image: FROM ubuntu:22.04 This allows DevOps teams to rebuild their custom images on top of the latest LTS base image, which automatically includes all updates, but is also unlikely to include the kind of breaking changes that can be introduced between major operating system versions. When creating Docker images hosting production software, it makes sense to base your images from the latest LTS release. These images are also kept up to date, with the publication of rolled up security updated images on a regular cadence, and you should automate your use of the latest images to ensure consistent security coverage for your users. LTS releases are supported for 5 years, and the associated Docker images are also maintained by Canonical during this period, as described on the Ubuntu release cycle page: Selecting a base imageĭocker images are provided for all versions of Ubuntu, including Long Term Support (LTS) releases such as 20.04 and 22.04, and normal releases like 19.04, 19.10, 21.04, and 21.10.
Docker ubuntu how to#
Now that you've seen how to build a custom image from the Ubuntu base image, let's go through each of the settings to understand why they were added. RUN echo 'APT::Install-Recommends "0" ' > /etc/apt//00-dockerīuild the image with the command: docker build. RUN echo 'APT::Install-Suggests "0" ' > /etc/apt//00-docker I go through each of the settings to explain what value they add: FROM ubuntu:22.04 This is an example Dockerfile that includes the tweaks discussed in this post. In this post, I show you how to make the most of the base Ubuntu images while building your own Docker images. With over one billion downloads, Ubuntu has proven itself to be a popular and reliable base image on which to build your own custom Docker images.


The official Ubuntu Docker image is the most downloaded image from Docker Hub.
