Build an image from the Dockerfile in the current directory
docker image build .
Build an image with repository and tag from a root directory
docker image build -t myRepo:myTag /my/root/dir/
List images
docker image ls
docker images
docker image rm web1
docker image inspect web1
docker image tag web1 adr1/web1:latest
docker image push adr1/web1:latest
docker container ls
docker container ls -a
docker container run -it alpine sh
or docker run -it alpine sh
docker container run -it web1
docker container run -it -p5000:5000 web1
docker container run -it -p5000 web1
docker container run -it -p5000:5000 -e FLASK_APP=app.py -e FLASK_DEBUG=1 web1
docker container run -it -p5000:5000 -d web1
docker container run -it -rm -p5000:5000 web1
docker container run -it --name web1 -p5000:5000 web1
docker container run -it --name web1 --restart on-failure -p5000:5000 web1
docker container run -it -p 5000:5000 -e FLASK_APP=app.py --rm --name web1 -e FLASK_DEBUG=1 -v $PWD:/app web1
docker container rm web1
docker container rm $(docker ps -a -q)
docker container inspect web1
docker container exec -it web1 ls
docker container exec -it web1 sh
docker container exec -it --user "$(id -u):$(id -g)" touch hello.txt
docker pull adr1/web1:latest
Export from container to tarball
docker export myContainerId > myImage.tar
Import from tarball to repostory
docker import - myRepo < myImage.tar
Save repository to tarball
docker save -o myImage.tar myRepo
Load tarball to repository
docker load < myImage.tar