Solve the problem that Docker pulls MySQL image too slowly

Solve the problem that Docker pulls MySQL image too slowly

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 platform

Link: Alibaba Cloud Console, image search mysql

Copy accelerator link

2. Enter the virtual machine to modify the docker configuration

vim /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 MySQL

Supplement: Use Docker to pull the tomcat image and mysql image deployment implementation

Pull the tomcat image

Query 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 image

Query 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 image

docker 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:
  • Docker pull image and tag operation pull | tag
  • Docker image creation, uploading, pulling and deployment operations (using Alibaba Cloud)
  • Python script pulls Docker image problem
  • Complete steps for Docker to pull images
  • How to pull the docker image to view the version
  • Detailed explanation of Docker domestic image pulling and image acceleration registry-mirrors configuration modification

<<:  Vue+element+springboot to implement file download progress bar display function example

>>:  The Complete Guide to Grid Layout in CSS

Recommend

Detailed explanation of the use of ElementUI in Vue

Login + sessionStorage Effect display After a suc...

Docker installation tomcat dubbo-admin instance skills

1. Download the tomcat image docker pull tomcat:8...

How to deploy MySQL master and slave in Docker

Download image Selecting a MySQL Image docker sea...

MySQL 8.0.12 installation steps and basic usage tutorial under Windows

This article shares the installation steps and us...

Detailed explanation of custom events of Vue components

Table of contents Summarize <template> <...

Detailed explanation of CSS3 to achieve responsive accordion effect

I recently watched a video of a foreign guy using...

How to use Vue cache function

Table of contents Cache function in vue2 Transfor...

JavaScript design pattern learning adapter pattern

Table of contents Overview Code Implementation Su...

ftp remotely connect to Linux via SSH

First install ssh in Linux, taking centos as an e...

Introduction to the method attribute of the Form form in HTML

1 method is a property that specifies how data is ...

JavaScript basics for loop and array

Table of contents Loop - for Basic use of for loo...