To list down image
[root@ip-172-31-95-65 ~]# docker-compose images
Container Repository Tag Image Id Size
----------------------------------------------
[root@ip-172-31-95-65 ~]# docker-compose up -d
Creating root_webapp2_1 ... done
Creating root_webapp1_1 ... done
[root@ip-172-31-95-65 ~]# docker-compose images
Container Repository Tag Image Id Size
------------------------------------------------------------
root_webapp1_1 nginx latest 98ebf73aba75 104 MB
root_webapp2_1 nginx latest 98ebf73aba75 104 MB
[root@ip-172-31-95-65 ~]#
To check the status
[root@ip-172-31-95-65 ~]# docker-compose images
Container Repository Tag Image Id Size
----------------------------------------------
[root@ip-172-31-95-65 ~]# docker-compose up -d
Creating root_webapp2_1 ... done
Creating root_webapp1_1 ... done
[root@ip-172-31-95-65 ~]# docker-compose images
Container Repository Tag Image Id Size
------------------------------------------------------------
root_webapp1_1 nginx latest 98ebf73aba75 104 MB
root_webapp2_1 nginx latest 98ebf73aba75 104 MB
[root@ip-172-31-95-65 ~]#
To check the status
[root@ip-172-31-95-65 ~]# docker-compose ps
Name Command State Ports
--------------------------------------------------------------------
root_webapp1_1 nginx -g daemon off; Up 0.0.0.0:8000->80/tcp
root_webapp2_1 nginx -g daemon off; Up 0.0.0.0:8002->80/tcp
To pause the docker conatiner
[root@ip-172-31-95-65 ~]# docker-compose pause
Pausing root_webapp2_1 ... done
Pausing root_webapp1_1 ... done
[root@ip-172-31-95-65 ~]# docker-compose ps
Name Command State Ports
---------------------------------------------------------------------
root_webapp1_1 nginx -g daemon off; Paused 0.0.0.0:8000->80/tcp
root_webapp2_1 nginx -g daemon off; Paused 0.0.0.0:8002->80/tcp
To unpause the docker container
[root@ip-172-31-95-65 ~]# docker-compose unpause
Unpausing root_webapp1_1 ... done
Unpausing root_webapp2_1 ... done
[root@ip-172-31-95-65 ~]# docker-compose ps
Name Command State Ports
--------------------------------------------------------------------
root_webapp1_1 nginx -g daemon off; Up 0.0.0.0:8000->80/tcp
root_webapp2_1 nginx -g daemon off; Up 0.0.0.0:8002->80/tcp
[root@ip-172-31-95-65 ~]#
No comments:
Post a Comment