If you want to exit bash, there are two options: The first one: Ctrl + d to exit and stop the container; Second type: Ctrl + p + q to exit and run the container in the background; Additional knowledge: Docker starts multiple services at the same time In the previous Docker articles, only one background service was started when starting a container. Today, let’s talk about how to start multiple services through supervisor. 1. First create a directory and create a Dockerfile in the directory. The content of the file is as follows
2. Create the supervisord.conf file in the directory where the Dockerfile is located. The content is as follows:
3. Run the build command in the directory where Dockerfile is located to generate the image file. Here, mysql_server is used as the image file name.
4. Start the container 4.1 First use the following command to start the container
4.2 After starting the container, you can use "sudo docker ps" to view it. At this time, you can see that the PORTS column content is
The container's ports 22 and 3306 will be mapped to the host machine's ports 49171 and 49172. 4.3 Now you can access the ssh and mysql services through the following commands
4.4 Of course, you can also use "sudo docker inspect myserver | grep IPAddress" to view the container IP address, and then access the ssh and mysql services through the following commands
The above two methods to exit bash from docker container under Linux are all the content shared by the editor. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: The presentation and opening method of hyperlink a
>>: Vue uses drag and drop to create a structure tree
As shown below: XML/HTML CodeCopy content to clip...
1 / Copy the web project files directly to the we...
How can we say that we should avoid 404? The reas...
Table of contents Preface 1. Error log 2. Binary ...
1. Usage scenarios There is such a requirement, s...
Let’s look at the effect first: This effect looks...
This article example shares the specific code of ...
This document records the installation and config...
Method 1: Use CSS overflow omission to solve The ...
After installing MySQL, enter mysql -u root -p in...
Table of contents 1. Communication method between...
Unicode Signature BOM - What is the BOM? BOM is th...
1. Introduction to Varnish Varnish is a high-perf...
Prepare the bags Install Check if Apache is alrea...
Table of contents 1. Introduction 2. select 2.1 Q...