- Docker Tutorial
- Docker - Home
- Docker - Overview
- Docker - Installing Docker on Linux
- Docker - Installation
- Docker - Hub
- Docker - Images
- Docker - Containers
- Docker - Working With Containers
- Docker - Architecture
- Docker - Container & Hosts
- Docker - Configuring
- Docker - Containers & Shells
- Docker - File
- Docker - Building Files
- Docker - Public Repositories
- Docker - Managing Ports
- Docker - Private Registries
- Building a Web Server Docker File
- Docker - Instruction Commands
- Docker - Container Linking
- Docker - Storage
- Docker - Networking
- Docker - Setting Node.js
- Docker - Setting MongoDB
- Docker - Setting NGINX
- Docker - Toolbox
- Docker - Setting ASP.Net
- Docker - Cloud
- Docker - Logging
- Docker - Compose
- Docker - Continuous Integration
- Docker - Kubernetes Architecture
- Docker - Working of Kubernetes
- Docker Useful Resources
- Docker - Quick Guide
- Docker - Useful Resources
- Docker - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Docker - Hub
Docker Hub is a registry service on the cloud that allows you to download Docker images that are built by other communities. You can also upload your own Docker built images to Docker hub. In this chapter, we will see how to download and the use the Jenkins Docker image from Docker hub.
The official site for Docker hub is − https://www.docker.com/community-edition#/add_ons
Step 1 − First you need to do a simple sign-up on Docker hub.
Step 2 − Once you have signed up, you will be logged into Docker Hub.
Step 3 − Next, let’s browse and find the Jenkins image.
Step 4 − If you scroll down on the same page, you can see the Docker pull command. This will be used to download the Jenkins image onto the local Ubuntu server.
Step 5 − Now, go to the Ubuntu server and run the following command −
sudo docker pull jenkins
To run Jenkins, you need to run the following command −
sudo docker run -p 8080:8080 -p 50000:50000 jenkins
Note the following points about the above sudo command −
We are using the sudo command to ensure it runs with root access.
Here, jenkins is the name of the image we want to download from Docker hub and install on our Ubuntu machine.
-p is used to map the port number of the internal Docker image to our main Ubuntu server so that we can access the container accordingly.
You will then have Jenkins successfully running as a container on the Ubuntu machine.