There is a medicine for regret in the world, as long as you are willing to think about it! No more recreating containers! I have a container called m2 and now I want to change its hostname 1. Check the location of the container configuration file on the host machine. Here we see /var/lib/docker/containers/67e012c02434168aff3762ab4edf7550f0bfe1db57b396ce78660f140dd3056e 2. Shut down the container and shut down the docker service prerequisites, which is very important! ! ! Prerequisites are very important! ! ! Prerequisites are very important! ! ! 3. Enter the host folder where the configuration file of the container is located, search for the original hostname, and you can see that we need to modify three places, the files are config.v2.json, hostname, hosts 4. Make a backup before modifying 5. Modify these 3 places 6. Start the docker service, start the container, and check the hostname hostname modified successfully! Are you surprised? ! ! This concludes this article on the detailed process of modifying the hostname after Docker creates a container. For more information about modifying the hostname of a Docker container, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL multi-instance installation boot auto-start service configuration process
>>: About the role of meta in HTML (collected and sorted from the Internet)
I installed MySQL on Windows by unzipping the com...
The default operating mode of MySQL is autocommit...
1 Introduction Redis is a high-performance NoSQL ...
After the changes: innodb_buffer_pool_size=576M -...
HTML form tag tutorial, this section mainly expla...
Table of contents What is maintainable code? Code...
Nginx uses a fixed number of multi-process models...
HTML Design Pattern Study Notes This week I mainl...
Table of contents 1. Anti-shake 2. Throttling 3. ...
Text Shadow text-shadow: horizontal offset vertic...
@vue+echarts realizes the flow effect of China ma...
By default, MySQL can accept the insertion of 0 v...
Table of contents 1. Understanding the stack stru...
Table of contents Thoughts triggered by an online...
Use the rpm installation package to install mysql...