Issue
I specify in Dockerfile FROM ubuntu:jammy
but the image built is <none>
. It does not appear to be dangling. I am following a tutorial and can't see the reason why the name is <none>
instead of ubuntu:jammy
. I'm on Windows 11 WSL.
sergio@Home-Win11:/mnt/Linkedin-Docker-Essential-Training/04_03_before$ cat Dockerfile
#my first dockerfile
FROM ubuntu:jammy
sergio@Home-Win11:/mnt/c/Linkedin-Docker-Essential-Training/04_03_before$ docker image build .
[+] Building 1.0s (5/5) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 76B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:jammy 0.8s
=> CACHED [1/1] FROM docker.io/library/ubuntu:jammy@sha256:aabed3 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:18f1928b30e0cc26fd9e768656be0c61f3fc5e 0.0s
sergio@Home-Win11:/mnt/c/Linkedin-Docker-Essential-Training/04_03_before$ docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
redis latest da63666bbe9a 7 days ago 138MB
nginx latest 61395b4c586d 7 days ago 187MB
portainer/portainer-ce latest d7f7a88e1acc 8 days ago 294MB
<none> <none> 18f1928b30e0 6 weeks ago 77.8MB
hello-world latest 9c7a54a9a43c 4 months ago 13.3kB
sergio@Home-Win11:/mnt/c/Linkedin-Docker-Essential-Training/04_03_before$ docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
redis latest da63666bbe9a 7 days ago 138MB
nginx latest 61395b4c586d 7 days ago 187MB
portainer/portainer-ce latest d7f7a88e1acc 8 days ago 294MB
<none> <none> 18f1928b30e0 6 weeks ago 77.8MB
hello-world latest 9c7a54a9a43c 4 months ago 13.3kB
Solution
This is expected behaviour when:
- not specifying a tag:
docker build .
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 0ce4e70c517d now 77.8MB
- specifying a repository:
docker build -t mytag .
REPOSITORY TAG IMAGE ID CREATED SIZE
mytag latest 0ce4e70c517d now 77.8MB
- specifying a repository and tag:
docker build -t mytag:1.0 .
REPOSITORY TAG IMAGE ID CREATED SIZE
mytag 1.0 0ce4e70c517d now 77.8MB
Answered By - Sebastian Liebscher Answer Checked By - Dawn Plyler (WPSolving Volunteer)