Docker command workflow

From HPCWIKI
Jump to navigation Jump to search

Following slide show a high level Docker commands from Dockerfile to Dockerhub or private Dockerhub.

commands State from State to Example Notes
build/compose Dockerfile or compose file docker image build docker image from source
run docker image docker container execute image as container
commit docker container docker image apply change in container to image
stop/start/restart docker container docker container start/stop/restart container
save docker image tarball docker save IMAGE > /path/to/file.tardocker save -o /path/to/file.tar IMAGE
load tarball docker image docker load /path/to/file.tar
export docker container tarball docker export CONTAINER > /path/to/file.tardocker export -o /path/to/file.tar CONTAINER Export without history and metadata
import tarball docker image docker import --change 'CMD ["/bin/bash"]' /pat/to/file.tar exported image is just one layer so need to define new Dockerfile or put start options with import --chanage options
push local image remote image docker tag

docker push

login to hub then push
pull remote image local image docker pull pull remote hub image to local image

login required for private hub

Docker file to hub

References