Installing Docker
Introduction
Docker is an open-source application container engine that features portability, scalability, high security, and manageability. Developers can package applications and dependencies into portable containers, quickly release them to Linux servers, and use the OS-level virtualization to build, deploy, and manage applications more efficiently. This section describes how to install Docker in HCE 2.0.
Preparations
Prepare an ECS.
Prerequisites
A yum repository has been configured. For details about how to configure a yum repository accessed over the Internet, see Configuring Repositories and Installing Software for HCE.
Procedure
- Install Docker.
- Run the following command to install Docker:
dnf install docker
- Run the following command to start Docker:
systemctl start docker
- Run the following command to install Docker:
- Verify that Docker is installed.
If the Docker version is displayed, Docker is installed successfully, as shown in Figure 1.
docker -v

Docker 18.09.0 is installed. To install a later version, see Docker Documentation.
Using Docker
- Manage the Docker daemon.
- Run the daemon.
systemctl start docker
- Stop the daemon.
systemctl stop docker
- Restart the daemon.
systemctl restart docker
- Run the daemon.
- Manage images. The nginx image is used as an example. You need to prepare a local image file nginx_latest.tar.
- Import a local image.
docker load -i <nginx_latest.tar file path>
- Edit the label.
# Change the version of the nginx image from latest to v1. docker tag nginx:latest nginx:v1
- View existing images.
docker images
- Forcibly delete an image.
docker rmi -f nginx:v1
- Import a local image.
- Manage containers.
- Start a container.
# Create and start a container from an image. The image ID can be obtained by running docker images. docker run -it <image-ID> /bin/bash
- Exit a container.
exit
- Start a container in the background.
docker run -itd <image-ID>
- Check all running containers.
docker ps
- Enter a container running in the background. You can run docker ps to obtain the container ID.
docker exec -it <Container ID> /bin/bash
- Create an image from the container. The container ID can be obtained by running docker ps.
docker commit <Container ID> [<Repository name>[:<Label>]]
Example:
docker commit 135****9f757 nginx:v1
- Start a container.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot