How do I restart a Docker container/image/machine?

I’m trying to teach myself about Docker and using the docker-compose.yml to play around with images and the compose file. I’ve got the WordPress image up and running using successfully docker-compose.yml up -d via the tutorial here…, but as soon as I make changes to the compose file and docker-compose.yml up -d again I can’t access the changes again and have to completely delete images/containers/docker machine‘s to get my changes to work.

What am I doing wrong, what’s the process to restart/delete the minimum amount to see my docker-compose.yml changes so I can play around with docker-compose.yml?

  • How to run protractor end to end tests in docker container?
  • ?Docker commit -run '— deprecated, will be removed soon , how to replace
  • Unable to use a docker-container as the php interpreter in PhpStorm on Windows
  • How to deploy multi-tier application using Docker?
  • Deleting folders in docker conatiner using python
  • Can't connect to cassandra cluster, but can connect to single node?
  • Copy multiple directories with one command
  • Does docker notary key rotation invalidate all signed images?
  • Profile my app with Blackfire container in Docker environment
  • Docker: how to automatically accept “Do you really want to push to public registry?”
  • Docker error in Linux mint 17
  • Jenkins run external script with docker command
  • One Solution collect form web for “How do I restart a Docker container/image/machine?”

    docker-compose stop to stop the stack
    docker-compose start to start the stack

    Both above will not remove your container, but rather shutdown and start them again, without any loses, even on the container filesystem, not only the volumes

    docker-compose down will remove the containers of your services and all anonymous volumes assigned to them.

    Be aware, not all changes in the docker-compose file can be applied using start/stop, rather most of the time, you have to do a down/up. Things like volumes/ports cannot be hot-applied like this.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.