In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points of Docker Compose commands, which are detailed in content and clear in logic. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
The use of 1.docker compose is very similar to the use of the docker command, but it is important to note that most compose commands need to be executed in the same directory as the docker-compose.yml file.
2.compose runs in daemon mode with the-d option
$docker-compose up-d
3. To see what services are available, use the docker-compose ps command, which is very similar to docker's ps command
4. View compose Log
$docker-compose logs web$ docker-compose logs redis
5. Stop the compose service
$docker-compose stop$ docker-compose ps
See the status of the service is exit exit status
6. Restart the compose service
$docker-compose restart$ docker-compose ps
7.kill compose service
$docker-compose kill$ docker-compose ps
The status code is 137
8. Delete compose service
$docker-compose rm
9. More docker-compose commands can be viewed using docker-compose-- help
Docker-compose-- help you will see so many commands as follows
Build build or rebuild servicesbundle generate a docker bundle from the compose fileconfig validate and view the compose filecreate create servicesdown stop and remove containers, networks, images, and volumesevents receive real time events from containersexec execute a command in a running containerhelp get help on a commandimages list imageskill kill containerslogs view output from containerspause pause servicesport print the public port for a port bindingps list containerspull pull service imagespush push service imagesrestart restart servicesrm remove stopped containersrun run an one-off commandscale set number of containers for a servicestart start servicesstop stop servicestop display the running processesunpause unpause servicesup create and start containersversion show the docker-compose version information
Docker-compose up-d nginx build launches the nignx container
Docker-compose exec nginx bash logs in to the nginx container
Docker-compose down deletes all nginx containers, mirroring
Docker-compose ps displays all containers
Docker-compose restart nginx restart the nginx container
Docker-compose run-- no-deps-- rm php-fpm php- v does not start the associated container in php-fpm, and the container deletes the container after the php- v execution is completed
Docker-compose build nginx builds the image.
Docker-compose build-no-cache nginx builds without caching.
Docker-compose logs nginx views nginx's log
Docker-compose logs-f nginx view nginx's real-time log
Docker-compose config-Q verification (docker-compose.yml) file configuration, when the configuration is correct, do not output anything, when the file configuration error, output error information.
Docker-compose events-json nginx outputs nginx's docker log in the form of json
Docker-compose pause nginx pauses the nignx container
Docker-compose unpause nginx recovery ningx Container
Docker-compose rm nginx Delete the container (the container must be closed before deletion)
Docker-compose stop nginx stop nignx Container
Docker-compose start nginx starts the nignx container
These are all the contents of the article "what are the commonly used Docker Compose commands?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.