How to make docker image

王林
Release: 2020-04-05 14:46:34
Original
5830 people have browsed it

How to make docker image

1. Start the docker service first

systemctl start docker
Copy after login

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

Query centos related images

docker search centos
Copy after login

3. Download the image to the local

docker pull 镜像名
Copy after login

4. View the local image

docker images
Copy after login

5. Create and enter the container

Format:

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

How to make docker image

6. View all containers

docker ps -a
Copy after login

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 '制作者' 容器名 镜像名
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!