1. Introduction

Installing docker

In fact, the container is a process running on the image. Docker container is a process. For example, the image is a template, which exists on disk, and the container is an instance generated by the template.

To view the image on your system, use the Docker images command.

You’ll find it’s empty.

Because there’s no mirror image.

Let’s make a Hello world.

The first step is to download the image, using the docker pull command, for example:

$ docker pull hello-world
Copy the code

You may find that there is no reaction for half a day, not to mention downloading, because the place where the image is put is in a foreign country. Anyway, it is a little slow to visit in China, so you need to use the accelerator.

2. The accelerator

Someone has synchronized those images, put them on a server in the country, and we’ll download them much faster.

This is the accelerator.

There are many accelerators in China, and we use aliyun accelerators.

cr.console.aliyun.com/#/imageList

Post the following on the terminal:

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://oyukeh0j.mirror.aliyuncs.com"]
}
EOF
Copy the code

If I am ubuntu 14.04, I can restart the docker.

$ sudo /etc/init.d/docker restart
Copy the code

Try running Docker pull Hello-world again.

Is it fast?

If you don’t see results, try Docker Pull Sameersbn/Gitlab

This is on Ubuntu, but what about a MAC?

The end.

Docker containers (3)