Personal actual development of docker use notes

Docker default installation location: /var/lib/docker

1. Mirror operation instructions

1.docker help|grep image: View all operation instructions related to mirroring in docker

 

2.docker search mysql: Find the mirror image of mysql in the docker library

 

3.docker pull <mirror name>: download a mirror

For example, install mysql: docker pull mysql:tag (: version number, the default is the latest version)

 

4.docker push <11.181.12.14:8080/migu/composite-service:1.0.0>: push image

 

5.docker images: View the list of all mirrors of this machine

docker images|grep rbac: View the mirror information related to the local rbac

 

6.docker rmi rbac-server: delete rbac-server image

 

7.docker save rbac> /home/migu/ rbac.tar: save the rbac image as a tar package under the specified file path

 

8. Docker mirroring under the code that can be packaged normally: mvn clean install docker:build

 

 

Two, docker container

1.docker create [options] image [command] [arg....]: create and not run

docker run [options] image [command] [arg...]: create and run

 

2.docker ps: view all running containers

docker ps|grep rbac: Query containers whose container name contains rbac

 

3.docker stop rbac-server: stop the rbac-server container

docker rm -f rbac-server: delete the rbac-server container

 

4. docker rename original service name new service name: rename the container

 

5.docker inspect rbac-server: View the environmental information of the rbac-server container

 

6.docker exec -it rbac-server bash: enter the rbac-server container

exit: Exit the container

 

7. Copy from the outside to the container:

docker cp a.txt rbac-service:/home: copy the a.txt file to the container rbac-service

Copy files from the container to the system directory:

docker cp rbac-service:/home/a.txt /tmp: copy a.txt in rbac-service to /tmp;

 

8.docker diff ********: View the changes of a container since it was started

 

 

Three, docker network mode

1.docker network ls: View the current network modes supported by docker

 

Fourth, docker start and stop commands:

Start: 1. Manual start: systemctl start docker

2. Set to enable automatic startup: systemctl enable docker

Stop: systemctl stop docker

 

 

Guess you like

Origin blog.csdn.net/qq_37488998/article/details/111870746
Recommended