Docker Image: Commands And Their Usage

build

docker container build
docker image build --build-arg <arguments> -f <name of dockerfile>
docker image build -file <Dockerfile>
docker image build --rm -f <Dockerfile>
docker image build --quiet -f <Dockerfile>
docker image build -t <name>:<tag> -f <Dockerfile>

Inspect

  • a list of all the layers
  • metadata
  • OS
  • Config details
docker image inspect <id or name of image>

ls

docker image ls
docker image ls --all
docker image ls --digests

Prune

docker image prune
docker image prune --force

Pull

docker image pull <image name:<tag>>
docker image pull -a <image name>

Push

docker image push <name:<tag>>

rm

docker image rm <image name or id>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store