After half an hour of trying to pull the MySQL image with Docker, it still failed, so we used Alibaba Cloud Image Accelerator instead. 1. Enter the Alibaba Cloud platformLink: Alibaba Cloud Console, image search mysql Copy accelerator link 2. Enter the virtual machine to modify the docker configurationvim /etc/docker/daemon.json Editing Code { "registry-mirrors": ["https://nsodgxr5.mirror.aliyuncs.com"] } Restart Docker sudo systemctl daemon-reload sudo systemctl restart docker 3. Re-download MySQLSupplement: Use Docker to pull the tomcat image and mysql image deployment implementation Pull the tomcat imageQuery existing image command: docker search tomcat Note: name means name Description: Stars: Attention Official: Is it official? Automatexd: Is it privately created? Pull the image command of tomcat8.5 version: docker pull tomcat:8.5 Note: You can use the :xx method to select the version of the pulled container. View the pulled image command: docker images Run the tomcat image command: docker run --name mytomcat -p 8099:8080 -d tomcat Note: --name means to define a name yourself -p port, the first one indicates the port exposed to the client by the local machine, and the second one indicates the port of the docker container -d means running in the background Some commonly used commands:View the running container: docker ps Query existing image command: docker search tomcat View all containers: docker ps -a Shut down the running container: docker stop [container name] Start the running container: docker start [container name] Restart a running container: docker restart [container name] Delete the container: docker rm -v [container name] Delete the image: docker rmi [image name] Command to deploy the project: docker cp [project path] [container name]:/usr/local/tomcat/webapps/ Query the internal files of the container: docker exec -it [container name] /bin/bash Pull the mysql imageQuery existing image command: docker search mysql Pull the MySQL image command: docker pull mysql:5.6 View the pulled image command: docker images | grep mysql Run the mysql container command: docker run -p 3306:3306 --name mymysql -d mysql:5.6 -e MYSQL_ROOT_PASSWORD=123456 Deploy the project to the tomcat imagedocker cp /home/test/doctor mytomcat:/usr/local/tomcat/webapps/ Restart the image docker restart tomcat The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me. You may also be interested in:
|
<<: Vue+element+springboot to implement file download progress bar display function example
>>: The Complete Guide to Grid Layout in CSS
Join uses the Nested-Loop Join algorithm. There a...
1. Query speed of two query engines (myIsam engin...
Table of contents 1. Count data is lost Solution ...
View MySQL transaction isolation level mysql> ...
The Explain command is the first recommended comm...
Table of contents 1. Import files 2. HTML page 3....
【1】<i></i> and <em></em> ...
<br />User experience is increasingly valued...
describe When calling this interface, you need to...
Integrity constraints Integrity constraints are f...
I have recently been developing a visual operatio...
Problem description: When phpstorm's SFTP hos...
Table of contents 1. Environmental Preparation 2....
GitHub address: https://github.com/dmhsq/dmhsq-my...
1. Use of CSS scope (style division) In Vue, make...