May 22, 2021 Docker From entry to practice
You can
docker pull
command to get the image you want from the repository.
The following example will download a mirror image of the Ubuntu 12.04 operating system from the Docker Hub repository.
$ sudo docker pull ubuntu:12.04
Pulling repository ubuntu
ab8e2728644c: Pulling dependent layers
511136ea3c5a: Download complete
5f0ffaa9455e: Download complete
a300658979be: Download complete
904483ae0c30: Download complete
ffdaafd1ca50: Download complete
d047ae21eeaf: Download complete
During the download process, each layer of information that gets the image is output.
The command is actually
$ sudo docker pull registry.hub.docker.com/ubuntu:12.04
command, which downloads a mirror marked
12.04
from
ubuntu
in registration server
registry.hub.docker.com
Sometimes the official warehouse registration server downloads slowly and can be downloaded from other warehouses. W hen downloading from another warehouse, you need to specify the full warehouse registration server address. For example
$ sudo docker pull dl.dockerpool.com:5000/ubuntu:12.04
Pulling dl.dockerpool.com:5000/ubuntu
ab8e2728644c: Pulling dependent layers
511136ea3c5a: Download complete
5f0ffaa9455e: Download complete
a300658979be: Download complete
904483ae0c30: Download complete
ffdaafd1ca50: Download complete
d047ae21eeaf: Download complete
When you're done, you can use the image at any time, such as creating a container where you can run the bash app.
$ sudo docker run -t -i ubuntu:12.04 /bin/bash
root@fe7fc4bd8fc9:/#