Search code examples
dockerdocker-composeghost-blog

Volume doesn't reflect data


When I created my installation like this:

sudo docker run -d --name myBlog -p 3001:2368 -e url=http://xxxx.com -v /var/www/myBlog/:/var/lib/ghost --restart always ghost

I was under the impression that I was defining that what ever is on /var/lib/ghost would be available in /var/www/myBlog/ but it seems that's not the case, when I check on /var/www/myBlog/ there is an empty folder. I created a new post so it can have some data but nothing is there. Where exactly is the data being stored then? And is there a way I can access my current image that I'm using to see the files inside? I tried sudo docker run -it ghost but that gets me to the base image, not the one I'm using.


Solution

  • Please run the below command and you should be able to see files under target directory

    docker run -d  -e url=http://xxxx.com --name some-ghost -p 3001:2368 -v "$(pwd)/target":/var/lib/ghost/content ghost:1-alpine