Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Docker Basics
#1

    Docker Basics
   

Docker Basics


   

First, let us run Docker’s “Hello World” command as a start. To do it, we need to run the following command:

   
docker run hello-world
   

This test image is the one that Docker recommends checking every time you reinstall the utility.

   

We can verify all the images we have in our system with this command:

   
docker images
   

Or search the Docker repository for an available image with the search command.

   
docker search [search]
   

For example, we can search for an image related to CentOS 7.

   
docker search centos7
   

And if we want to download it, we can do it with the following command:

   
docker pull [image_name]
   

Finally, to execute it we will use the run command. We will be able to call the image by its ID or directly by its name.

   
docker run -t -i [image_id or image_name]
   

The option -i means that we will make the image interactive, while the option -t means we will have access to a terminal and can simulate one.

   

To exit from an image, we need to press CTRL+D.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)