๐ Edit page
โ Add page
Manage images
List
List images.
$ docker image ls
Or
$ docker images
Filter by name.
$ docker image ls my-app
Build
Create a container from an image.
Give the image a name with -t
flag. If you donโt do this, then a random name will be used and then it is harder to use docker run
as you then have to lookup a name.
$ docker build -t my-app .
Ignore cache.
$ docker build -t my-app . --no-cache
Pull
Download an Docker image from a container registry. See docs.
$ docker image pull REFERENCE
Get the latest
image:
$ docker image pull foo/bar
Get a named image such as with a release tag or branch name.
$ docker image pull foo.com/bar@v1.2.3
$ docker image pull ubuntu@lunar
$ docker image pull ubuntu@23.04
Use --all-tags
or -a
to download all tags in the image repository.
To use an image directly with an unnamed container:
$ docker image pull ubuntu
$ docker run ubuntu
Or use the name in Dockerfile like FROM ubuntu
.
See ubuntu on Docker Hub.