In Docker, everything is based on Images. An image is a combination of a file system and parameters. Let’s take an example of the following command in Docker. Docker run hello-world The Docker command is specific and tells the Docker program on the Operating System that something needs to be done. Follow the instructions for creating a docker image that can be used as a Jenkins Agent; Docker Environment. Follow the installation steps on the docker website. If your Jenkins instance is not on the same OS as the docker install, you will need to open the docker TCP port so that Jenkins can communicate with the docker daemon. Oct 06, 2020 Install Docker Compose on RHEL 8 / CentOS 8. Follow our separate guide on installation of latest Docker Compose on Linux. Install Docker Compose on Linux. For the sake of keeping this guide brief, we won’t dive into Docker compose usage. I’ll recommend you go through Official Docker documentation and Docker Compose documentation to learn more.

  • Docker Tutorial
  • Docker Useful Resources

Sep 29, 2020 docker build -t jenkins:jcasc. This step involves downloading and installing many plugins into the image, and may take some time to run depending on your internet connection. Once the plugins have finished installing, run the new Jenkins image: docker run -name jenkins -rm -p 8080:8080 jenkins:jcasc. The Blue Ocean suite of plugins are not bundled with official Jenkins Docker image (jenkins/jenkins), which is available from the Docker Hub repository. Read more about running Jenkins and Blue Ocean inside Docker in the Docker section of the Installing Jenkins page.

  • Selected Reading

In Docker, everything is based on Images. An image is a combination of a file system and parameters. Let’s take an example of the following command in Docker.

  • The Docker command is specific and tells the Docker program on the Operating System that something needs to be done.

  • The run command is used to mention that we want to create an instance of an image, which is then called a container.

  • Finally, 'hello-world' represents the image from which the container is made.

Now let’s look at how we can use the CentOS image available in Docker Hub to run CentOS on our Ubuntu machine. We can do this by executing the following command on our Ubuntu machine −

Note the following points about the above sudo command −

  • We are using the sudo command to ensure that it runs with root access.

  • Here, centos is the name of the image we want to download from Docker Hub and install on our Ubuntu machine.

  • ─it is used to mention that we want to run in interactive mode.

  • /bin/bash is used to run the bash shell once CentOS is up and running.

Displaying Docker Images

To see the list of Docker images on the system, you can issue the following command.

This command is used to display all the images currently installed on the system.

Syntax

Options

None

Return Value

The output will provide the list of images on the system.

Example

Docker Install Jenkins Facebook

Output

When we run the above command, it will produce the following result −

Docker install windows

From the above output, you can see that the server has three images: centos, newcentos, and jenkins. Each image has the following attributes −

  • TAG − This is used to logically tag images.

  • Image ID − This is used to uniquely identify the image.

  • Created − The number of days since the image was created.

  • Virtual SizeSafari for windows 10 latest version. − The size of the image.

Downloading Docker Images

Images can be downloaded from Docker Hub using the Docker run command. Let’s see in detail how we can do this.

Syntax

The following syntax is used to run a command in a Docker container.

Options

  • Image − This is the name of the image which is used to run the container.

Return Value

The output will run the command in the desired container.

Example

This command will download the centos image, if it is not already present, and run the OS as a container.

Output

When we run the above command, we will get the following result −

You will now see the CentOS Docker image downloaded. Now, if we run the Docker images command to see the list of images on the system, we should be able to see the centos image as well.

Removing Docker Images

The Docker images on the system can be removed via the docker rmi command. Let’s look at this command in more detail.

This command is used to remove Docker images.

Syntax

Options

  • ImageID − This is the ID of the image which needs to be removed.

Return Value

The output will provide the Image ID of the deleted Image.

Example

Here, 7a86f8ffcb25 is the Image ID of the newcentos image.

Output

When we run the above command, it will produce the following result −

Let’s see some more Docker commands on images.

docker images -q

Docker Install Jenkins Job

This command is used to return only the Image ID’s of the images.

Docker install jenkins job

Syntax

Options

  • q − It tells the Docker command to return the Image ID’s only.

Return Value

The output will show only the Image ID’s of the images on the Docker host.

Example

Output

When we run the above command, it will produce the following result −

docker inspect

Docker Jenkins Install Jdk

This command is used see the details of an image or container.

Syntax

Options

  • Repository − This is the name of the Image.

Docker Install Jenkins Linux

Return Value

The output will show detailed information on the Image.

Example

Output

Docker Install Jenkins Model

When we run the above command, it will produce the following result −

Coments are closed
Scroll to top