Docker command workflow

From HPCWIKI
Revision as of 17:02, 25 May 2023 by Admin (talk | contribs) (Created page with "Following slide show a high level Docker commands from Dockerfile to Dockerhub or private Dockerhub. {| class="wikitable" |+ !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 contain...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 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
Docker file to hub

References