Docker compose is a tool to define and running multiple container Docker applications. In this tutorial, to learn more about docker compose command. Docker the essential for DevOps Roles.
“Build, Manage and Secure Your Apps Anywhere. Your Way.” Quote from docker!
Docker compose command
Start existing containers
[root@DevopsRoles ~]# docker-compose start
The screen output terminal:
[root@DevopsRoles docker-instance]# docker-compose start Starting DB01 ... done Starting WEB01 ... done
Stop existing containers
[root@DevopsRoles ~]# docker-compose stop
The screen output terminal:
[root@DevopsRoles docker-instance]# docker-compose stop Stopping db01 ... done Stopping web01 ... done
Pauses running containers
[root@DevopsRoles ~]# docker-compose pause
The screen output terminal:
[root@DevopsRoles docker-instance]# docker-compose pause Pausing web01 ... done Pausing db01 ... done
Unpause all processes containers
[root@DevopsRoles ~]# docker-compose unpause
The screen output terminal:
[root@DevopsRoles docker-instance]# docker-compose unpause Unpausing db01 ... done Unpausing web01 ... done
List all running containers.
[root@DevopsRoles ~]# docker-compose ps
The screen output terminal:
Creating and starting a container
[root@DevopsRoles ~]# docker-compose up
Stop and remove containers, networks, images, and volumes
[root@DevopsRoles ~]# docker-compose down
The screen output terminal:
[root@DevopsRoles docker-instance]# docker-compose down Stopping db01 ... done Stopping web01 ... done Removing db01 ... done Removing web01 ... done Removing network docker-instance_bridge
Conclusion
Thought the article, you can use “Docker compose command as above”. I hope will this your helpful. Thank you for reading the DevopsRoles page!