<p>I wouldn't suggest making a 16.04 image since that was EOL as of April 2021.  You can search the docker hub for &quot;ubuntu 16.04&quot; and find several instances of it</p>
<pre><code>$ docker pull ubuntu:16.04

Trying to pull repository docker.io/library/ubuntu ...
16.04: Pulling from docker.io/library/ubuntu
58690f9b18fc: Pull complete
b51569e7c507: Pull complete
da8ef40b9eca: Pull complete
fb15d46c38dc: Pull complete
Digest: sha256:0f71fa8d4d2d4292c3c617fda2b36f6dabe5c8b6e34c3dc5b0d17d4e704bd39c
Status: Downloaded newer image for docker.io/ubuntu:16.04
</code></pre>
<p>and then run it with:</p>
<pre><code>$ docker run -it --rm ubuntu:16.04 /bin/bash
root@b912d2c0db04:/# cat /etc/os-release
NAME=&quot;Ubuntu&quot;
VERSION=&quot;16.04.7 LTS (Xenial Xerus)&quot;
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=&quot;Ubuntu 16.04.7 LTS&quot;
VERSION_ID=&quot;16.04&quot;
HOME_URL=&quot;http://www.ubuntu.com/&quot;
SUPPORT_URL=&quot;http://help.ubuntu.com/&quot;
BUG_REPORT_URL=&quot;http://bugs.launchpad.net/ubuntu/&quot;
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
</code></pre>
<p>and you can use <code>FROM ubuntu:16.04</code> in your docker files to reference it.</p>
<p>The <code>16.04</code> after the colon in the name identifies which version you're pulling down, if you don't specify it, there's some convention that defaults to latest, which would be 20.04, until sometime in April 2022.</p>

CC BY-SA 4.0
2022-03-03T14:26:18.730Z
2022-03-03T14:26:18.730Z
Peter Turner
<p>I am just slowly getting into Docker. I want to create an Ubuntu 16.04 image. I know that docker run -it ubuntu creates an ubuntu image but when I do that, I get 20.04</p>

<docker><ubuntu>
How to create an Ubuntu image for 16.04
Levent Ozbek
# How to create an Ubuntu image for 16.04

(Asked by: username_0 on 2022-03-03)

I am just slowly getting into Docker. I want to create an Ubuntu 16.04 image. I know that docker run -it ubuntu creates an ubuntu image but when I do that, I get 20.04

**Tags:** docker, ubuntu


---

## 1 answers

### Answer by username_1 on 2022-03-03. Score: 6

I wouldn't suggest making a 16.04 image since that was EOL as of April 2021.  You can search the docker hub for "ubuntu 16.04" and find several instances of it
$ docker pull ubuntu:16.04

Trying to pull repository docker.io/library/ubuntu ...
16.04: Pulling from docker.io/library/ubuntu
58690f9b18fc: Pull complete
b51569e7c507: Pull complete
da8ef40b9eca: Pull complete
fb15d46c38dc: Pull complete
Digest: sha256:0f71fa8d4d2d4292c3c617fda2b36f6dabe5c8b6e34c3dc5b0d17d4e704bd39c
Status: Downloaded newer image for docker.io/ubuntu:16.04

and then run it with:
$ docker run -it --rm ubuntu:16.04 /bin/bash
root@b912d2c0db04:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.7 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.7 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

and you can use FROM ubuntu:16.04 in your docker files to reference it.
The 16.04 after the colon in the name identifies which version you're pulling down, if you don't specify it, there's some convention that defaults to latest, which would be 20.04, until sometime in April 2022.


---

