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
This article shares with you the detailed install...
The code looks like this: <!DOCTYPE html> &...
Background Information I've been rereading so...
After installing Navicat The following error may ...
Copy code The code is as follows: <html> &l...
Table of contents 1. Nodes, trees, and virtual DO...
1. Install vue-cli npm i @vue/cli -g 2. Create a ...
Learn about similar methods for getting character...
Official Website https://cli.vuejs.org/en/guide/ ...
Table of contents 0x0 Introduction 0x1 Installati...
The code looks like this: SELECT @i:=@i+1 rowNum,...
Table of contents Question: answer: Reality: Know...
Preface This article mainly introduces the releva...
For reference only for Python developers using Ub...
File transfer between Windows and Linux (1) Use W...