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

MYSQL database basics - Join operation principle

Join uses the Nested-Loop Join algorithm. There a...

MySQL query optimization: a table optimization solution for 1 million data

1. Query speed of two query engines (myIsam engin...

MySQL Null can cause 5 problems (all fatal)

Table of contents 1. Count data is lost Solution ...

Detailed explanation of Mysql transaction isolation level read commit

View MySQL transaction isolation level mysql> ...

Explain how to analyze SQL efficiency

The Explain command is the first recommended comm...

js realizes packaging multiple pictures into zip

Table of contents 1. Import files 2. HTML page 3....

Chinese website user experience rankings

<br />User experience is increasingly valued...

How to assign a public IP address to an instance in Linux

describe When calling this interface, you need to...

Analysis of SQL integrity constraint statements in database

Integrity constraints Integrity constraints are f...

Sample code for implementing history in vuex

I have recently been developing a visual operatio...

Solve the problem that PhpStorm fails to connect to VirtualBox

Problem description: When phpstorm's SFTP hos...

How to build a SOLO personal blog from scratch using Docker

Table of contents 1. Environmental Preparation 2....

Summary of the use of CSS scope (style splitting)

1. Use of CSS scope (style division) In Vue, make...