


With an interactive shell, you can work inside the container, which is similar to working inside a VPS. If you need an interactive shell: docker run -it centos


Replace ‘ image_name‘ with the name of an actual image. When you run an image, you can see a running Docker container.ĭocker images can be run with: docker run image_name To list all the images downloaded to your workstation: docker imagesĪs discussed previously, Docker containers are instances of these images. If the image exists in the hub, you can download it with: docker pull centosĬheck out the screenshot for a better picture. You can see if a particular image is available in Docker hub with: docker search centos Images are therefore the basis of containers.īy default, images are pulled from a repository provided by Docker called Docker Hub. If you start a particular image, you’ll get a running container of this image. Instances of Docker images are called Docker containers. How to run a Docker container with these commands can be seen in the coming sections.ĭocker Images and pulling images from Docker Hubīefore anything else, let’s clarify what a Docker image is. To see the available switches of a subcommand: docker docker-subcommand -help Syntax of Docker command is as follows: docker This can be done with: sudo usermod -aG docker username To execute Docker command as a normal user, it is required to add that user to the docker group. Let’s see how it can be executed.īy default, executing Docker command requires root or sudo privilege. You will be able to manage Docker containers with Docker command now. There you go! Docker client or Command line utility is now available. Here is how it looks like if the service is active. Status of Docker service can be verified with: sudo systemctl status docker This screen marks the completion of installation: This will install latest version of Docker. If curl is installed, just run: curl -fsSL | sh To install curl, run: sudo yum install curl For this to work, curl needs to be installed in the server first. To install it with the script, just download the package from the docker official website with curl and run it. It is recommended to install it with their installation script because the Docker installation package might not be the latest in CentOS’ official repo. Kernel version equal to or greater than 3.10ĭocker can be installed with yum utility or directly from the installation script.In this tutorial, we will show you how Docker can be installed and used on a server running CentOS 7. Docker containers are resource-friendly, portable and secure. It helps in the easy deployment, testing and shipping of applications or codes. Docker is software platform used to run applications in isolated containers, similar to virtual machines.
