Fading Coder

One Final Commit for the Last Sprint

Home > Notes > Content

Docker Installation and Mirror Configuration

Notes 1

Switching to Root User

su

Removing Previous Docker Versions

If Docker is already installed on the system, first remove the existing version:

yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine

Configuring Docker Repository

First, install the yum-utils package:

yum install -y yum-utils

After successful installation, configure Docker's repository:

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Installing Docker

Execute the following command to install Docker:

yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Starting and Verifying Docker

Check Docker version:

docker -v

Enable Docker to start on boot:

systemctl enable docker

Start Docker service:

systemctl start docker

Verify Docker is running correctly:

docker images

Configuring Docker Mirror Accelerator (Free)

First, visit the official cloud service provider website and register an account

Access the console and navigate to the container image service

Follow the provider's documentation to configure the mirror accelerator. Execute the following commands in your Linux terminal:

  1. Create Docker configuration directory:
mkdir -p /etc/docker
  1. Note: The mirror address below is an example. Replace with your actual mirror URL.
tee /etc/docker/daemon. <<-'EOF'
{
  "registry-mirrors": ["https://your-mirror-url.example.com"]
}
EOF
  1. Reload systemd configuration:
systemctl daemon-reload
  1. Restart Docker service:
systemctl restart docker

After configuring the mirror accelerator, Docker application deployment will be significantly faster

Related Articles

Designing Alertmanager Templates for Prometheus Notifications

How to craft Alertmanager templates to format alert messages, improving clarity and presentation. Alertmanager uses Go’s text/template engine with additional helper functions. Alerting rules referenc...

Deploying a Maven Web Application to Tomcat 9 Using the Tomcat Manager

Tomcat 9 does not provide a dedicated Maven plugin. The Tomcat Manager interface, however, is backward-compatible, so the Tomcat 7 Maven Plugin can be used to deploy to Tomcat 9. This guide shows two...

Skipping Errors in MySQL Asynchronous Replication

When a replica halts because the SQL thread encounters an error, you can resume replication by skipping the problematic event(s). Two common approaches are available. Methods to Skip Errors 1) Skip a...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.