kraag22
kraag22

Reputation: 3514

Error when running ghost docker image second time

I can run docker container with ghost with this command (https://hub.docker.com/_/ghost/):

docker run -ti -v /tmp/data:/var/lib/ghost/content -p2368:2368 ghost

But only when /tmp/data is empty. If I try to stop this container with Ctrl+c and run it again, it fails with this error:

docker run -ti -v /tmp/data:/var/lib/ghost/content -p2368:2368 ghost
chown: changing ownership of '/var/lib/ghost/content/themes/casper': No such file or directory

I need to store ghost's data outside container and this is the way based on documentation. Am I missing something?

I'm trying this on Mac.

Upvotes: 1

Views: 717

Answers (2)

zuzkins
zuzkins

Reputation: 36

I had same problem when running ghost under Docker for Mac.
I would suggest to create docker volume for your data, rather than mounting direct folder. There seems to be a problem with resolving symlinks.

docker volume create ghost-data
docker run -it --mount source=ghost-data,target=/var/lib/ghost/content -p 2368:2368 ghost

Upvotes: 2

nephilim_boy
nephilim_boy

Reputation: 46

i had this problem before but when i pull the latest version (docker pull ghost:latest) again everything work fine,,, i guess the chown on the ghost image Dockerfile made the ownership error....

Upvotes: -1

Related Questions