New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tar: /var/lib/ghost/content.orig: Cannot open: No such file or directory #69

Closed
twiceyuan opened this Issue Aug 2, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@twiceyuan
Copy link

twiceyuan commented Aug 2, 2017

I use docker compose to create it, the configuration file approximately is:

services:
  blog:
    image: "ghost:latest"
    ports:
      - 1984:2368
    volumes:
      - [data directory]:/var/lib/ghost

The data directory is a new directory and I have full permissions. But it seems failed, the logs show this:

tar: /var/lib/ghost/content.orig: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

And after this I can see the content directory was created in the data directory. Is anything wrong?

@weipah

This comment has been minimized.

Copy link

weipah commented Aug 2, 2017

I ran into the same issue.

Happens only, when I mount an empty folder to /var/lib/ghost
When I don't mount a volume it works.

I tried
sudo docker run -it --name ghost-blog-1.0 -v /var/www/ghost:/var/lib/ghost -p 2368:2368 ghost:1.0

I think this doesn't work, because the /content/ folder is created in the Dockerfile and not in the entrypoint-script. A workaournd could be to create a symlink maybe, eg. ln -s $SOME_DIR /var/lib/ghost

Also I took note that the variable $BASH_SOURCE in entrypoint-script seems to be unrecognized from within the container. It's not declared in the Dockerfile.

@pascalandy

This comment has been minimized.

Copy link
Contributor

pascalandy commented Aug 2, 2017

I solved it.

Explaination

I took a look at the Dockerfile. You can see here that the Docker Ghost 1.0 now use /var/lib/ghost/content and NOT /var/lib/ghost/

When I run it locally:

docker run -d \
--name ghostone \
-p 3001:2368 \
-v /Users/myusername/Documents/gstdatatest:/var/lib/ghost/content \
ghost:1.0.2-alpine

Docs

I will do a PR on the readme over here for this breaking change.

Please let me know if you guys can replicate :)

Cheers!
Pascal

@weipah

This comment has been minimized.

Copy link

weipah commented Aug 3, 2017

Thanks, @pascalandy that was a real stupid one! sigh

Although now I'm running into another issue, but I don't think that is related.

tar: themes/casper: Cannot utime: Operation not permitted

@weipah

This comment has been minimized.

Copy link

weipah commented Aug 3, 2017

I figured the problem is that I'm mapping a local drive from windows machine and tar somehow cannot update the access/read/edit (utime) time on the filesystem with tar.

For now I went on a simplyfied approach for the copying of the files in the entrypoint-script.

if [[ "$*" == node*current/index.js* ]] && ! ls $GHOST_CONTENT/* 1>/dev/null 2>&1; then
  cp -R $GHOST_INSTALL/content.orig/* $GHOST_CONTENT/
  chown -R node:node "$GHOST_CONTENT"
  knex-migrator-migrate --init --mgpath "$GHOST_INSTALL/current"
fi

Cheers,
Mark

@pascalandy

This comment has been minimized.

Copy link
Contributor

pascalandy commented Aug 4, 2017

I think we should close this issue :)

@acburdine

This comment has been minimized.

Copy link
Collaborator

acburdine commented Aug 4, 2017

Ok 😄

A solution has been posted by @pascalandy -> if the issue persists comment and we can reopen or create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment