In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. The parameter restart=always is not added when the container is created, which results in that the container fails to start automatically when Docker is restarted.
An example of docker container update-restart=always container name operation is as follows: [root@localhost mnt] # docker ps-aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES46cdfc60b7a6 nginx "nginx-g 'daemon..." About a minute ago Up 42 seconds 80/tcp n379d55a734c26 nginx "nginx-g 'daemon..." About a minute ago Up 42 seconds 80/tcp n2f7b2206c019d nginx "nginx-g 'daemon..." About a minute ago Up 46 seconds 80/tcp N1 [root@localhost mnt] # docker container update-- restart=always n1n1 [root@localhost mnt] # systemctl restart docker [root@localhost mnt] # docker ps-aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES46cdfc60b7a6 nginx "nginx-g' Daemon... "2 minutes ago Exited (0) 5 seconds ago n379d55a734c26 nginx" nginx-g'daemon... "2 minutes ago Exited (0) 5 seconds ago n2f7b2206c019d nginx" nginx-g 'daemon... "2 minutes ago Up 2 seconds 80/tcp N1
2.docker-compose shuts down or restarts docker while restarting the configuration of container restart always
As we all know, if you start using docker, you need to add-restart=always to achieve this function, while if you use docker-compose, you can add restart: always to the relevant service configuration.
Version: '2'services: database: build:. / mysql/ command: mysqld-- user=root-- verbose restart: always environment: MYSQL_DATABASE: "web_level3_sqli" MYSQL_USER: "web_level3_sqli" MYSQL_PASSWORD: "thisisasecurepassword123" MYSQL_ROOT_PASSWORD: "root" MYSQL_ALLOW_EMPTY_PASSWORD: "yes" web: build:. / www/ Restart: always ports:-"12000 www/src:/var/www/html links 80" volumes: -. / www/src:/var/www/html links:-database
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.