Docker Tutorial 2: Pulling Image
After installed the docker, we can try to pull image from Docker hub, which is the step 1 of the image below, which including:
- search images
- pull images
- display images
- save images
- load images
- remove images
(Sik-Ho Tsang @ Medium)
- We can
search
the docker repository from the Docker hub.
sudo docker search ubuntu
2. Use pull
command to pull the image ubuntu:18.04
. We can see that a new image is downloaded showing pull complete.
sudo docker pull ubuntu:18.04
3. We can display all the images pulled by images
:
sudo docker images
4. We can save
the image as tar file.
sudo docker save -o ubuntu.18.04.tar ubuntu:18.04
5. Certainly, we can load
the image from tar file.
sudo docker load --input ubuntu.18.04.tar
6. And remove the image by rmi
.
sudo docker rmi ubuntu:18.04
Thus, these are some basic commands for pulling images. :)
References
SUPERCHARGE YOUR DEVELOPMENT ENVIRONMENT https://denibertovic.com/talks/supercharge-development-env-using-docker
Day 4 關於 Image 的那些大小事https://ithelp.ithome.com.tw/articles/10193334