From a1c30d0af927f7f4e90f5d2d426d99846c7221a0 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 21 Jun 2023 22:21:36 +0200 Subject: [PATCH] remove ubuntu 18.04 from examples Ubuntu 18.04 reached end of standard support, so remove it from examples in our docs. Signed-off-by: Sebastiaan van Stijn --- compose/compose-file/compose-file-v2.md | 2 +- compose/compose-file/compose-file-v3.md | 4 ++-- .../develop-images/dockerfile_best-practices.md | 12 +++++++----- storage/storagedriver/index.md | 14 ++++++++------ 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/compose/compose-file/compose-file-v2.md b/compose/compose-file/compose-file-v2.md index c1a47fc3a3..28d389e188 100644 --- a/compose/compose-file/compose-file-v2.md +++ b/compose/compose-file/compose-file-v2.md @@ -856,7 +856,7 @@ a partial image ID. image: redis ``` ```yaml -image: ubuntu:18.04 +image: ubuntu:22.04 ``` ```yaml image: tutum/influxdb diff --git a/compose/compose-file/compose-file-v3.md b/compose/compose-file/compose-file-v3.md index a21e55b72a..0e53e9a022 100644 --- a/compose/compose-file/compose-file-v3.md +++ b/compose/compose-file/compose-file-v3.md @@ -805,7 +805,7 @@ services: placement: constraints: - "node.role==manager" - - "engine.labels.operatingsystem==ubuntu 18.04" + - "engine.labels.operatingsystem==ubuntu 22.04" preferences: - spread: node.labels.zone ``` @@ -1302,7 +1302,7 @@ a partial image ID. image: redis ``` ```yaml -image: ubuntu:18.04 +image: ubuntu:22.04 ``` ```yaml image: tutum/influxdb diff --git a/develop/develop-images/dockerfile_best-practices.md b/develop/develop-images/dockerfile_best-practices.md index 0031ecb823..f3d2f0a396 100644 --- a/develop/develop-images/dockerfile_best-practices.md +++ b/develop/develop-images/dockerfile_best-practices.md @@ -24,7 +24,8 @@ changes from the previous layer. The following is the contents of an example Doc ```dockerfile # syntax=docker/dockerfile:1 -FROM ubuntu:18.04 + +FROM ubuntu:22.04 COPY . /app RUN make /app CMD python /app/app.py @@ -32,7 +33,7 @@ CMD python /app/app.py Each instruction creates one layer: -- `FROM` creates a layer from the `ubuntu:18.04` Docker image. +- `FROM` creates a layer from the `ubuntu:22.04` Docker image. - `COPY` adds files from your Docker client's current directory. - `RUN` builds your application with `make`. - `CMD` specifies what command to run within the container. @@ -448,7 +449,8 @@ subsequent `apt-get install` instructions fail. For example, the issue will occu ```dockerfile # syntax=docker/dockerfile:1 -FROM ubuntu:18.04 + +FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y curl ``` @@ -458,7 +460,8 @@ modify `apt-get install` by adding an extra package as shown in the following Do ```dockerfile # syntax=docker/dockerfile:1 -FROM ubuntu:18.04 + +FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y curl nginx ``` @@ -890,4 +893,3 @@ These Official Images have exemplary Dockerfiles: * [Guidelines for Creating Docker Official Images](../../docker-hub/official_images.md) * [Best practices to containerize Node.js web applications with Docker](https://snyk.io/blog/10-best-practices-to-containerize-nodejs-web-applications-with-docker){:target="_blank" rel="noopener" class="_"} * [More about Base Images](../../build/building/base-images.md) - diff --git a/storage/storagedriver/index.md b/storage/storagedriver/index.md index ad9df53a4b..cb0a450e95 100644 --- a/storage/storagedriver/index.md +++ b/storage/storagedriver/index.md @@ -39,7 +39,8 @@ read-only. Consider the following Dockerfile: ```dockerfile # syntax=docker/dockerfile:1 -FROM ubuntu:18.04 + +FROM ubuntu:22.04 LABEL org.opencontainers.image.authors="org@example.com" COPY . /app RUN make /app @@ -48,7 +49,7 @@ CMD python /app/app.py ``` This Dockerfile contains four commands. Commands that modify the filesystem create -a layer. The `FROM` statement starts out by creating a layer from the `ubuntu:18.04` +a layer. The `FROM` statement starts out by creating a layer from the `ubuntu:22.04` image. The `LABEL` command only modifies the image's metadata, and does not produce a new layer. The `COPY` command adds some files from your Docker client's current directory. The first `RUN` command builds your application using the `make` command, @@ -157,14 +158,15 @@ usually `/var/lib/docker/` on Linux hosts. You can see these layers being pulled in this example: ```console -$ docker pull ubuntu:18.04 -18.04: Pulling from library/ubuntu +$ docker pull ubuntu:22.04 +22.04: Pulling from library/ubuntu f476d66f5408: Pull complete 8882c27f669e: Pull complete d9af21273955: Pull complete f5029279ec12: Pull complete -Digest: sha256:ab6cb8de3ad7bb33e2534677f865008535427390b117d7939193f8d1a6613e34 -Status: Downloaded newer image for ubuntu:18.04 +Digest: sha256:6120be6a2b7ce665d0cbddc3ce6eae60fe94637c6a66985312d1f02f63cc0bcd +Status: Downloaded newer image for ubuntu:22.04 +docker.io/library/ubuntu:22.04 ``` Each of these layers is stored in its own directory inside the Docker host's