1. Docker command:A.docker PS: List all running containers: B.docker ps-a: List all containers (including sleeping mirrors)
C.docker Images: Lists the image images that are owned on the local host:
D.docker run:run mysql:1.docker Run--name zabbix_mysql-e mysql_root_password=secret-d mysql:latest
2.docker exec-it Zabbix_mysql Bash
3.mysql-u root-p
4.show Database
5.use MySQL;
6.show tables;
7.select * from user;
8.exit (Exit Database)
9.exit (Exit Container)
Run Zabbix:1.docker Inspect Zabbix_mysql
2.docker Run--name zabbix_server-p 8081:80 (http: External Port)-P 10051:10051 (port Zabbix server specifically communicates with agent)--env= "zs_dbhost= 172.17.0.2 "--env=" Zs_dbuser=root "--env=" Zs_dbpassword=secret "-D (background run) zabbix/zabbix_server_2.4:latest
E.dokcer Compose (run multiple images at once): (1) 1. Go to git website 2.3.sudo chmod +x ~/docker-compose 4.sudo mv ~/docker-compose/usr can be redirected first /local/bin 5. Check if Docker compose is installed: Docker-compose version (2) If I want to docker-compose up (Zabbix, MySQL) at once. The docker-compose.yml file should be configured like this: Zabbix: image:zabbix/zabbix_server_2.4 container_name:zabbix_server links: -MySQL ports: & nbsp; -8081:80 -10051:10051 environment: & nbsp; -zs_dbhost=Zabbix_mysql -Zs_ Dbuser=root -Zs_ Dbpassword=secret dns: -192.168.0.6
Restart:always
Mysql:image:mysql Container_name:zabbix_mysql hostname:zabbix_mysql Ports:-3 306:3306 Environment:-Mysql_root_password=secret DNS:-192.168.0.6 Res Tart:always Docker registry compose:
Frontend
image:konradkleine/docker-registry-frontend:v1-deprecated
Container_name:docker_registry_frontend_v1
Links
-Registry
Ports
-8,080:80
Environment:
-env_docker_registry_host=docker_registry_v0.9.1
-env_docker_registry_port=5000
-Env_mode_browse_only=false
Dns:
-192.168.0.6
Restart:always
Registry
image:registry:0.9.1
container_name:docker_registry_v0.9.1
Ports
-5,000:5,000
Dns:
-192.168.0.6
Restart:always
2. Docker registry operation Steps
If We don ' t have a registry:.*tar,we should Docker pull registry:.* (for example:registry:0.9.1) or we can use registry. *tar directly.
Step One:docker pull registry:0.9.1; Step Two:docker Load < ~/docker-registry-fronted-v1.tar; Step Three:docker images; Step Four:docker run-d-P 5000:5000 registry:0.9.1; Step Five:docker PS; Step Six:docker run-d-e env_docker_registry_host=192.168.2.120-e env_docker_registry_port=5000-e ENV_MODE_BROWSE_ Only=false-p 8080:80 konradkleine/docker-registry-fronted:v1-deprecated; Step Seven:docker PS; Step Eight:docker pull Hello-world; Step Nine:docker images; Step ten:docker Tag Hello-world:latest localhost:5000/hello-world:latest step eleven:docker Push Localhost:5000/ Hello-world; (If we ssh to some host such like 192.168.2.120 and we add a line "docker_opts=" $DOCKER _opts--insecure-registry=192.168.2 .120:5000 "To/etc/default/docker (we should use sudo permission) Step Twelve:sudo service Docker restart; Then we can Docker rmi-f Localhost:5000/hello-world Ps:①we should stop Zabbix firstly other than MySQL if we start These images we should reverse order. &nbsP ②we should stop fronted firstly other than registry if we start these the images we should order.
3, Docke Registry Construction Tutorial
4. Docker Registry Usage Instructions