Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to manage remote docker containers through puppet

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to manage remote docker containers through puppet, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

Use scripts to access the docker container:

Root@docker:~#. / control.sh What you want to do?try input 'help' to get some tips (please input the words in''): accessPlease input the specific container's name:web1root@050ebb07cf25:/# # has entered the docker container, enter exit to exit, but the script will also exit

Get help (try more commands):

Root@docker:~#. / control.sh What you want to do?try input 'help' to get some tips (please input the words in''): help#### # The helping information about this script # # COMMAND INFO # # 'status' get the info about the running containers. 'access' access the specific contianer. 'manage' manage the contianer,such as' start','stop' and 'delete'. 'exit' exit this script. 'statusa' show the infomation about all containers. 'statusl' show the latest infomation about container. # # MAINCOMMAND SUBCOMMAND INFO # # 'manage'' start' launch an exist contianer 'manage' 'stop' stop a running container' manage' 'delete' detele a not-running container' manage' 'status' get the info about the running containers' manage' 'statusa' show the infomation about all containers. 'manage' 'statusl' show the latest infomation about container. # # What you want to do?try input 'help' to get some tips (please input the words in'):

Stop container, delete container, start container:

Stop container web1:

Root@docker:~#. / control.sh What you want to do?try input 'help' to get some tips (please input the words in''): managePlease input the container name which you want to manage,or 'exit' Or 'help'?: statusRunning container:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES050ebb07cf25 training/webapp:latest "python app.py" 12 minutes ago Up 12 minutes 0.0.0.0 minutes ago Up 2000-> 5000/tcp web1 0ef5d56e4c89 training/webapp:latest "python App.py "12 minutes ago Up 12 minutes 0.0.0.0 minutes 1000-> 5000/tcp web1/webbase Webbase Please input the container name which you want to manage,or 'exit',or' help'?: web1Do you want to 'start' or' stop' or 'delete' your container?: stopNotice:container is stoppingweb1Please input the container name which you want to manage,or' exit',or 'help'?:

Web1 was stopped.

Start container web1:

Please input the container name which you want to manage,or 'exit',or' help'?: web1Do you want to 'start' or' stop' or 'delete' your container?: startNotice:Please make sure this container is not runningweb1Please input the container name which you want to manage,or' exit' Or 'help'?: statusRunning container:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES050ebb07cf25 training/webapp:latest "python app.py" 14 minutes ago Up 6 seconds 0.0.0.0 minutes ago Up 2000-> 5000/tcp web1 0ef5d56e4c89 training/webapp:latest "python App.py "14 minutes ago Up 14 minutes 0.0.0.0 minutes 1000-> 5000/tcp web1/webbase Webbase Please input the container name which you want to manage,or 'exit',or' help'?:

Web1 started again.

Delete container web1 (it must be closed first):

Please input the container name which you want to manage,or 'exit',or' help'?: web1Do you want to 'start' or' stop' or 'delete' your container?: stopNotice:container is stoppingweb1Please input the container name which you want to manage,or' exit' Or 'help'?: statusRunning container:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES0ef5d56e4c89 training/webapp:latest "python app.py" 15 minutes ago Up 15 minutes 0.0.0.0 minutes 1000-> 5000/tcp web1/webbase,webbase # web1 is closed Please input the container name which you want to manage,or' exit' Or 'help'?: web1Do you want to' start' or 'stop' or' delete' your container?: deleteNotice:You cannot delete a running container,if the container is running,please stop it firstborn web1Please input the container name which you want to manage,or 'exit' Or 'help'?: statusaAll infomation about containers:\ nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES0ef5d56e4c89 training/webapp:latest "python app.py" 17 minutes ago Up 17 minutes 0.0.0.0purl 1000-> 5000/tcp webbase 4de1685a386e Training/webapp:latest "/ bin/bash" 37 hours ago Exited (0) 37 hours ago backstabbing_lovelace c915cb516b02 training/webapp:latest "python app.py" 37 hours ago Exited (- 1) 37 hours ago clever_mccarthy # No information about web1

Web1 deleted

Tips: enter exit under the manage session, which will return to the main session, and enter the exit exit script again:

Root@docker:~#. / control.sh What you want to do?try input 'help' to get some tips (please input the words in''): managePlease input the container name which you want to manage,or 'exit' Or 'help'?: exit # exit manage session ExitingWhat you want to do?try input' help' to get some tips (please input the words in''): exit root@docker:~# in exit # main session all the contents of the article "how to manage remote docker containers through puppet" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report