docker build . |
Build an image from the Dockerfile in the current folder |
docker build -f <file> . |
Build an image from <file> in the current folder |
docker build -t <name> . |
Build an image and tag it with <name>:latest |
docker build -t <name>:<tag> . |
Build an image and tag it with <name>:<tag> |
docker build --no-cache . |
Build an image without cache |
docker build --target <stage> . |
Build an image up to stage <stage> |
docker build --build-arg MYARG=myvalue . |
Build an image with the build argument MYARG |
docker tag <image> <name>:<tag> |
Tag an image <image> with another tag <tag> |
docker tag <image> <registry>/<project>/<name>:<tag> |
Tag an image <image> for a private registry |
docker image push <name>:<tag> |
Push a tag to the registry |
docker image push --all-tags <name> |
Push all tags to the registry |
docker image prune -a --filter "until=24h" |
Delete all unused images older than 24h |
docker system prune |
Delete all unused Docker objects |
docker run <image> <args> |
Start an image with arguments. Overwrites CMD |
docker run --entrypoint="<command>" <image> |
Start an image with a different entrypoint |