Restart ghost blog running inside Docker

I’m using the Official Ghost Docker Image, and have ghost running without a problem.

I am developing a theme locally on the host, which is mounted as a volume inside the container. As with any running ghost instance, in order to see the theme changes, I need to stop and restart ghost.

  • Launching run docker from cloud-init incorrectly prefixes “” to image name
  • Ansible roles task failing docker swarm node join
  • Linux command output as input at particular location of another command.?
  • How to create privilege (per user) in Kibana
  • php composer with docker build: failed to clone git
  • Rename docker machine
  • Normally this would simply mean ending the Node process and running npm start again. But inside the official Docker image, this is not an option. If I try and run npm start, I’m told:

    ERROR: (EADDRINUSE) Cannot start Ghost.

    which makes sense, as the port is already in use.

    I’ve tried manually killing the processes with no success. If I kill the node process with

    kill -9 *node process ID*

    The container crashes out. I’ve tried also killing the npm process, but this never seems to go down.

    Any ideas?

  • Docker for Windows does not work with Volumes
  • Shared library in containers
  • W: Size of file /var/lib/apt/lists/http.debian.net_debian_dists_jessie_main_binary-amd64_Packages.gz is not what the server reported 9101219 9117278
  • Docker user Permission denied on accessing folder in container
  • iptables not working on macvlan traffic in container
  • How to use volumes-from in marathon
  • One Solution collect form web for “Restart ghost blog running inside Docker”

    This is how i deploy my ghost blog docker:

    docker run --name some-blog -d -p 80:2368 -e -v /home/ghost/blogfiles/:/var/lib/ghost --restart unless-stopped ghost

    The --restart unless-stopped is useful for when docker containers randomly crash. It will automatically restart them.

    Now for your question, list your docker containers by doing a docker ps you should get something like this:

    CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                            NAMES
    11d2517205de        ghost                    "/ npm s"   2 hours ago         Up About a minute>2368/tcp                             some-blog

    To restart the docker container you can either do docker stop [container id] and docker start [container id] or simply docker restart [container id].

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