Basic Commands for Docker Containers

by | Jun 29, 2017

We're finishing today the series of articles in which we have advanced a small part of the Containers for Developers and Quality Assurance training course from The Linux Foundation. In previous posts, we talked about how to build container blocks, configuring Docker environment and Docker Machine. In this post we are going to introduce some basic commands to operate with containers and Docker images.

To perform container operations, we should first connect to our “dockerhost” with Docker Machine. Once connected, we can start the container in interactive mode and explore the different processes inside the container.

For example, the command “docker container ls” lists the containers being executed. With the command “docker container inspect” we can inspect an individual container. Using the command “docker container exec” we can start a new process inside a container which is already running and perform some operations. We can use the “docker container stop” command to stop a container and delete a container that is no longer active using the command “docker container rm”.

To perform operations with Docker image, first we should also make sure that we are connected to our “dockerhost” with Docker Machine, so that all Docker commands are executed in the “dockerhost” that runs on DigitalOcean cloud.

The basic commands that are needed in this case are similar to the previous ones. With the command “docker image ls” we obtain a list of the available images in our “dockerhost”. Using the command “docker image pull” ** we can extract an image from our Docker Registry. And we can remove an image from “dockerhost” using the “docker image rm” command.

Source: Linux.com

SHARE

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Recent posts

VDI: The most secure environment for hybrid working

Today is Data Privacy Day. The purpose of this date is to raise awareness and promote privacy and data protection best practices. It was initiated by the European Commission, the Council of Europe, and the Data Protection authorities of the European Union’s member states. Their main goal was to drive attention to the importance of privacy, user data protection, and compliance of the General Data Protection Regulation (RGPD). It is a regulation characterized by significant fines for non-compliance since its implementation in 2018.

Archives


Stay up to date with all the news from UDS ENTERPRISE through our social networks. Follow us!

Skip to content