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
Login + sessionStorage Effect display After a suc...
error message: ERROR 2002 (HY000): Can't conn...
The JavaScript hasOwnProperty() method is the pro...
1. Download the tomcat image docker pull tomcat:8...
Download image Selecting a MySQL Image docker sea...
This article shares the installation steps and us...
0x0 Parameter verification Most of the parameter ...
Table of contents Summarize <template> <...
I recently watched a video of a foreign guy using...
Table of contents Cache function in vue2 Transfor...
Table of contents Overview Code Implementation Su...
First install ssh in Linux, taking centos as an e...
What I have been learning recently involves knowl...
1 method is a property that specifies how data is ...
Table of contents Loop - for Basic use of for loo...