Docker common operations

Image:
docker pull centos pull
docker save centos > centos.tar export
docker load < centos.tar import

container :
docker run -i -t centos /bin/bash
-i open standard input STDIN
-t allocate pseudo terminal pseudo-TTY
centos Image name
/bin/bash Run the bash program

in the container docker attach 197beb401e65 Enter the container

docker exec -i -t 197beb401e65 ls -l List the current directory structure of the container

docker rm -f $(docker ps -a -q) Delete all containers
$( docker ps -a -q) Get all container IDs

docker export 197beb401e65 > centos.tar export container package
docker import foo.tar zhan5/centos:latest container import image

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326907189&siteId=291194637