question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ghost CLI won't run in (community supported) ghost docker image

See original GitHub issue

Issue Summary

When run in Ghost community docker image, ‘ghost’ cli refuses to run (b/c ghost was installed as root).

To Reproduce

  1. Install Ghost in docker image from: https://hub.docker.com/_/ghost/
  2. After some time, come back to make a configuration change in image:

Expect: Ghost CLI works

Observe:

$ docker exec -it docker_blog_1 sh
# ghost ls
You can't run commands as the 'root' user.
Switch to your regular user, or create a new user with regular account privileges and use this user to run 'ghost ls'.
For more information, see https://docs.ghost.org/install/ubuntu/#create-a-new-user-.

This behavior is not unexpected, it is documented. But I’m raising it as a bug nevertheless because it’s a policy not a technical restriction and (sez me) that it is inappropriate in a container environment.

There, the container provides a sandbox for the rest of the host system, and the “root” user in the container has no more privilege than a regular user in the host system. So even if Ghost is running as root in the container and the hacker exploits a code execution flaw, s/he can own all of Ghost but still cannot access the host system.

Technical details:

  • Ghost Version: 2.6.0
  • Node Version: 10.15.3
  • Browser/OS: Debian 9 (stretch)
  • Database: sqlite3

Bug submission checklist

Please fill out this checklist to acknowledge that you followed the requirements to submit a bug report.

  • Tried to find help in the forum & docs
  • Checked for existing issues
  • Attached log file
  • Provided technical details incl. operating system

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
acburdinecommented, Jan 11, 2021

Opened https://github.com/TryGhost/Ghost-CLI/pull/1374 to address the issue, should have it released in the next version 😄

0reactions
acburdinecommented, Jan 11, 2021

These are valid points - i’ll look into adding a --allow-root flag or something that disables that check.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ghost - Official Image | Docker Hub
Ghost is a free and open source blogging platform written in JavaScript. ... base Ghost image, many of the other Ghost-CLI commands won't...
Read more >
Ghost-CLI - A fully loaded tool for installation and configuration
The best way to install, manage, and update your site locally or when self-hosting Ghost. A full guide for our advanced CLI tool....
Read more >
Ghost blog won't update - Coding Help - Glitch Support
Working directory is not a recognisable Ghost installation. Run ghost update again within a folder where Ghost was installed with Ghost-CLI.
Read more >
How to set up ghost - DigitalOcean
Because of this, SSL setup won't work correctly. Once you've set up your domain and pointed it at this server's IP, try running...
Read more >
How to Install Ghost CMS on CentOS 8 - Linode
Install Ghost using the Ghost-CLI tool. ... Installing Ghost in the /root or /home/{user} folder won't work and results in a broken setup....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found