Copyright, without permission, is prohibited reprint
chapter
- Docker Introduction
- Docker and the difference between virtual machines
- Docker installation
- Docker Hub
- Docker mirror (image)
- Docker container (Container)
- Docker container operations
- Docker container shell
- Docker Dockerfile
- Construction Docker mirror (docker build)
- Docker Dockerfile instruction
- Docker examples
- Docker Compose
- Docker network
Docker Hub is a community sharing Docker Docker mirror site / repository.
There are many Docker image above, for example: nginx official mirror, you can download these images from Docker Hub, you can also share your own image on it.
In this chapter we will demonstrate Docker image from Docker hub download and use of Jenkins.
Docker hub is the official site
Installation Jenkins Docker image
1. Find jenkins docker mirrored on the docker hub
In the search box jenkins
, find Jenkins official image, which is maintained by official Jenkins Mirror:
2. Install the mirror
Command can be seen in the figure above is mounted, the installation command CentOS system:
[kevin@qikegu ~]$ sudo docker pull jenkins
For more information on the installation command, you can refer Jenkins image details page on Docker Hub.
3. Run Jenkins
To run Jenkins image, execute the following command in CentOS,
[kevin@qikegu ~]$ sudo docker run -p 8080:8080 -p 50000:50000 jenkins
About the above command, note the following points
- Use
sudo
the command to ensure that the command is run with root privileges. jenkins
Is the image name.-p <主机端口>:<容器端口>
Docker mirrored internal port number mapped to the ports for host so that the external access.- This command in the Docker hub, Jenkins image details page contains a detailed account
Now, you have to let Jenkins as a container, successfully run.
Glossary
Docker we use a lot of terms that can be confusing. Before proceeding further, it is necessary to clearly understood that the common terms Docker Ecology.
- Mirror / Image - Mirror template container is essentially a file system, and applications, including the file dependent. In the above demonstration, we use the
docker pull
command to download jenkins image. - Container / Container - the container is a running instance mirrored. We used
docker run
to start a container, you can use thedocker ps
command to view the running container. - Docker daemon - that docker engine, manage mirror with container, running in the background on the host service. Linux daemon similar to the Windows background services.
- Client Docker - Docker command-line tool to interact with the daemon. There are also graphical tools such as Kitematic .
Simply look analogy, mirroring similar to the executable file, similar to the process vessel, Docker background / client equivalent system platform, image management and container.