Important Docker commands for Beginners

Syntax for using Docker command

$ docker [option] [command] [arguments]

Testing connection with Docker Hub

By default, all the images that are used are pulled from Docker Hub. We can upload or download an image for OS from Docker Hub. To make sure that we can do so, run

Searching an Image

To search for an image for the container, run

Downloading an image

Once we have searched and found the image we are looking for, we can download it by running,

Viewing downloaded images

To view all the downloaded images, run

Running an container

To run a container using the downloaded image , we will use

Displaying all docker containers

To view the list of all docker containers, run

Stopping a docker container

To stop a docker container, run

Exit from the container

To exit from the container, type

Saving the state of the container

Once the container is running & we have changed some settings in the container, like for example installed apache server, we need to save the state of the container. Image created is saved on the local system.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

LinuxTechLab is a beginner friendly website where you can learn Linux Tips & tricks,Scripting, also has lots of tutorials aimed at making Linux easy.