Skip to content
Permalink
Browse files

Don't use docker-compose down to stop containers

This delete containers and volume too. 
Use docker-compose stop who only stop containers
  • Loading branch information...
scaule committed Nov 28, 2017
1 parent e779bf9 commit 59dff53176fc0be55d1aab2511665db9e3cb6045
Showing with 2 additions and 2 deletions.
  1. +2 −2 sync.sh
@@ -63,7 +63,7 @@ if [ "$1" == "up" ] ; then

elif [ "$1" == "down" ]; then
print_style "Stopping Docker Compose\n" "info"
docker-compose down
docker-compose stop

print_style "Stopping Docker Sync\n" "info"
docker-sync stop
@@ -86,4 +86,4 @@ else
print_style "Invalid arguments.\n" "danger"
display_options
exit 1
fi
fi

4 comments on commit 59dff53

@tomothumb

This comment has been minimized.

Copy link

replied Aug 29, 2019

What is the reason you don't delete volume?
Directory on host machine will be deleted together when volume deleted?

Does someone answer me?

@lanphan

This comment has been minimized.

Copy link
Contributor

replied Aug 30, 2019

It's ok to use docker-compose down.
It's true that down will delete all volumes and containers (and networks too), but data is already on host (if you want to persist data, you must mount before creating it), and data on host is not deleted when docker-compose down.

@shov

This comment has been minimized.

Copy link
Contributor

replied Aug 30, 2019

I'm using down always, the volumes with the data in safety on the host, you are going to lost all data that not on volumes, containers are going to be removed

@tomothumb

This comment has been minimized.

Copy link

replied Aug 30, 2019

Thank you, I got how a volume will be worked when it downed.

I'm still confusing the reason of this commit.
./sync.sh down => docker-compose stop

A command './sync.sh stop' should be added if 'docker-compose stop' is needed on some usage.
Then keep command simple ('./sync.sh down' work 'docker-compose down').
Instead of this commit.

Is there any reasonable reason?
sync.sh doesn't want more command interface??

Please sign in to comment.
You can’t perform that action at this time.