Ghost CLI won't run in (community supported) ghost docker image
See original GitHub issueIssue Summary
When run in Ghost community docker image, ‘ghost’ cli refuses to run (b/c ghost was installed as root).
To Reproduce
- Install Ghost in docker image from: https://hub.docker.com/_/ghost/
- 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:
- Created 4 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
Opened https://github.com/TryGhost/Ghost-CLI/pull/1374 to address the issue, should have it released in the next version 😄
These are valid points - i’ll look into adding a
--allow-root
flag or something that disables that check.