Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to start the docker container

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces how to start the docker container, the content is very detailed, interested friends can use for reference, I hope it can be helpful to you.

How do I start the docker container? There are many ways to start a docker container. For example, a container can be started in two ways.

1. One is based on creating a container and launching

Docker createdocker start

The other is to use run to create automatic startup, which is the stop startup in the state.

Docker start nginx1docker stop NAMES # stop docker restart NAMES # start

# service docker start

# docker run-run (create) a container

Docker run-d-p 0.0.0.0 name 18080-- name nginx1 nginx-d: let the container run in the background-P: map the network port used inside the container to the host we use-p: specify the port-- name: set the container name nginx is the container image docker pull nginx pull image

2. Docker enters the container system:

Enter a nginx1 container

Docker exec-it nginx1 / bin/bash-d: split mode: run in the background-I: interactive mode keeps STDIN open even if there is no attachment-t: assign a pseudo terminal / bin/bash: run the command bash shell

Another way to enter:

Docker attach centos6.3

On how to start the docker container to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report