The create command will only create the container but it will not run the container and not create any network
[root@ip-172-31-95-65 ~]# mv docker-compose2.yml docker-compose.yml
[root@ip-172-31-95-65 ~]# docker-compose create
[root@ip-172-31-95-65 ~]# docker network ls
NETWORK ID NAME DRIVER SCOPE
7263963a2ee3 bridge bridge local
6e7b7c015f1e host host local
a8d46c14262d none null local
[root@ip-172-31-95-65 ~]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
----------------------------------------------------------------------------------------
To remove the container use the rm command
[root@ip-172-31-95-65 ~]# docker-compose rm
Going to remove root_webapp2_1
Are you sure? [yN] y
Removing root_webapp2_1 ... done
[root@ip-172-31-95-65 ~]#
[root@ip-172-31-95-65 ~]# mv docker-compose2.yml docker-compose.yml
[root@ip-172-31-95-65 ~]# docker-compose create
[root@ip-172-31-95-65 ~]# docker network ls
NETWORK ID NAME DRIVER SCOPE
7263963a2ee3 bridge bridge local
6e7b7c015f1e host host local
a8d46c14262d none null local
[root@ip-172-31-95-65 ~]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
----------------------------------------------------------------------------------------
To remove the container use the rm command
[root@ip-172-31-95-65 ~]# docker-compose rm
Going to remove root_webapp2_1
Are you sure? [yN] y
Removing root_webapp2_1 ... done
[root@ip-172-31-95-65 ~]#
---------------------------------------------------------------------
To create the container and also network run the below command but it will not run the container
[root@ip-172-31-95-65 ~]# docker-compose up --no-start
------------------------------------------------------------------------------------------------
To start the all stop container use the below command.
[root@ip-172-31-95-65 ~]# docker-compose start
To stop the running container
[root@ip-172-31-95-65 ~]# docker-compose stop
To remove use
[root@ip-172-31-95-65 ~]# docker-compose rm
No comments:
Post a Comment