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… https://docs.docker.com/compose/wordpress/), 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?

  • Apache Marathon: Pod/Compose like?
  • Build/push image from jenkins running in docker
  • Set up Docker Swarm on an EC2
  • unable to connect through SSH key to bluemix container
  • Docker Node.js Cron
  • Docker build from source fails
  • Can't mount all files to docker container volume
  • Is it possible to mount a docker image and then access it (RO) as a normal directory or mounted device?
  • Virtualbox inside docker container without host dependency
  • Run docker with jenkins user inside jenkins container on Centos7
  • Node npm test to seeded postgres, Docker network container seeing varying results
  • How to pull a single image from any docker repository?
  • 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.