Docker 101 – Part 1
I will try to explain basic docker command on Centos 7 in this entry.
First, let’s talk about a little bit docker terms.
Docker is an open-source project that automates the deployment of applications inside software containers. Containers are like lightweight VMs
Docker image: a read-only Layer is called an image and a image never changes
Docker container: an instance of the image. In other words, container is a running
Docker Hub Registry:A public registry maintained by Docker. You can see the list of the repositories and dockerfiles from https://registry.hub.docker.com/
Dockerfile: A text file that contains all the commands you would normally execute manually in order to build a Docker image. It is like a Makefile. Example dockerfiles for mongodb can be seen at https://registry.hub.docker.com/_/mongo/
Docker is included by default in the CentOS-Extras repository(64 bit only). To install run the following command.
# yum install docker
Run the docker daemon and enable at startup
# service docker start
Redirecting to /bin/systemctl start docker.service
# chkconfig docker on
Note: Forwarding request to ‘systemctl enable docker.service’.
ln -s ‘/usr/lib/systemd/system/docker.service’ ‘/etc/systemd/system/multi-user.target.wants/docker.service’
You can use pull parameter to download an image or a repository from a Docker registry server.
As an example, the following command will pull the mongodb listed at https://registry.hub.docker.com/u/dockerfile/mongodb/
# docker pull dockerfile/mongodb
Pulling repository dockerfile/mongodb
0980bbd7909c: Pulling dependent layers
0980bbd7909c: Pulling image (latest) from dockerfile/mongodb
PS: This article was not finished yet.