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
1. Back button Use history.back() to create a bro...
Table of contents Preface 1. Key Elements of a Re...
Let me look at the example code first: 1. Common ...
This article records the installation and configu...
React is different from Vue. It implements route ...
MySQL deduplication methods 【Beginner】There are v...
HTML meta viewport attribute description What is ...
background An nginx server module needs to proxy ...
1. Error details Once when manually performing a ...
HTML text formatting tags 標簽 描述 <b> 定義粗體文本 ...
In the process of product design, designers always...
Related articles: Beginners learn some HTML tags ...
1. Understanding of transition attributes 1. The ...
The DATE_ADD() function adds a specified time int...
Structure related tags ---------------------------...