I. Basic commands for docker image operations
Take Image centos as an example
Search for docker search centos images
Download the image docker pull centos
Upload image docker push centos
Delete docker rmi centos
View image docker images
View the details of an image: docker inspect centos
Change tag docker. io/centos 21 yunwei: latest
Create an image docker commit Container ID image name
Save the image docker save-o testcentos.tar 21yunwei. latest
Load image docker load <tesetcentos.tar
2. Basic commands for docker container operations
Create container docker create-ti centos: latest set Container id to 3 adfasdfasdfasd
Start container docker start 3ad
Disable docker stop 3ad
Run the container docker run-ASD 3ad
Restart docker restart 3ad
View container docker ps or docker ps-
View container logs docker logs 3ad
Enter the container docker attach 3ad or docker exec-ti 3ad/bin/bash
Delete docker rm 3ad
Export container docker export 3ad> 21yunwei.tar
Import container cat 21yunwei.tar | docker import-test/centos: latest
3. Basic commands for docker warehouse operations
Build a local repository using registry
Docker run-d-p 5000: 5000/home/registry:/tmp/registry
Vim/etc/sysconfig/docker
Change the following code to add -- insecure-registry 192.168.2.75: 5000
OPTIONS = '-- selinux-enabled -- insecure-registry 192.168.2.75: 8080'