Home >Operation and Maintenance >Docker >How to make docker image

How to make docker image

王林
王林Original
2020-04-05 14:46:345965browse

How to make docker image

1. Start the docker service first

systemctl start docker

2. Pull a pure centos system image from the remote warehouse

Query centos related images

docker search centos

3. Download the image to the local

docker pull 镜像名

4. View the local image

docker images

5. Create and enter the container

Format:

docker  run  -dit  --name=容器名  镜像 id  /bin/bash

How to make docker image

6. View all containers

docker ps -a

7. Operate containers

Install the environment in the container. What I installed here is python3

How to make docker image

8. After installing the environment, exit the container

Use exit to exit the container

9. Make the container into a mirror format

:

docker  commit  -m  '镜像描述'  -a  '制作者'  容器名  镜像名

Recommended related tutorials: docker tutorial

The above is the detailed content of How to make docker image. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn