-d: Run the container in the background and return the container ID; -i: Run the container in interactive mode, usually used with -t; -t: reallocate a pseudo input terminal for the container, usually used together with -i; Additional knowledge: docker-compose starts nginx through sh command and the container automatically exits with code 0 In the template file used by docker-compose, the container is started automatically by executing the sh command through the entrypoint or command parameter to start the nginx service, but the container automatically exits after docker-compose up
Reason: Docker's mechanism is to run the container in the background. There must be at least one foreground process. If the command run by the container is not a command that has been suspended (such as running top, tail), it will automatically exit. Solution: You can use the sh command containing the -g "daemon off;" configuration item to start the nginx service in the foreground mode.
If the container needs to start multiple processes at the same time, just suspend one of them to the foreground, for example:
or
The above article "The status is always Exited after docker run" is all the content that the editor shared with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Solve the problem that MySQL read-write separation causes data not to be selected after insert
>>: Solve the mobile terminal jump problem (CSS transition, target pseudo-class)
Preface It's a cliché. Here I will talk about...
MySQL is a very powerful relational database. How...
When you start working on a project, it’s importa...
1. Download MySQL URL: https://dev.mysql.com/down...
Table of contents 1. Introduction 2. Output Infor...
This article shares the specific code of making a...
When a request is sent to your server to display ...
1. Introduction First of all, we need to answer a...
Because li is a block-level element and occupies ...
Table of contents Overview Form validation withou...
The most understandable explanation of the accura...
This article example shares the specific code of ...
In this article, we will need to learn how to vie...
1. Time formatting and other methods It is recomm...
1 Download MySQL Download address: http://downloa...