docker-library / ghost Goto Github PK
View Code? Open in Web Editor NEWDocker Official Image packaging for Ghost
Home Page: https://hub.docker.com/_/ghost
License: MIT License
Docker Official Image packaging for Ghost
Home Page: https://hub.docker.com/_/ghost
License: MIT License
Hello Folks!
I love the work Docker is doing for Ghost. It's super easy run and update from version to version. The official image is great!
I tried to build Ghost 1.0.0-alpha.21 and I could not run Ghost successfully :-\
Wondering if someone have found a way to run the alpha version in Docker.
Cheers!
Is there a way to develop themes and use this Dockerfile? I've tried mounting a volume $PWD/my_theme/:/usr/src/ghost/content/themes/my_theme
and the directory is created in /var/lib/ghost/themes
but the files are not copied over. I'm not quite sure why as the entrypoint.sh
copies all directories and I'm assuming the files with it as well. Has anybody had experience with this or does the entrypoint.sh
need to be updated to allow mounted volumes to be recursed over for files inside of directories?
I've also tried directly mounting to /var/lib/ghost/themes
but then the casper
theme is not located there. This might be a separate issue, but I can't figure out why it would disappear. Wouldn't the entrypoint.sh
still copy the files from /usr/src/ghost
?
When I used to run dockerfile/ghost
, I could easily use the ghost-overide
directory for symlinking the content folder to my containerised blog.
Yesterday I upgraded it to use the new official ghost docker image, and all hell breaks loose. The path to ghost installation has changed, and there is no documentation on how to override except issue #6 which is equally vague.
And the official method to override using -v /path/to/blog/:/var/lib/ghost/
simply doesn't work.
How do I fix this?
After switch of
0.7.9 version to 0.10.0
i get the following exception on start
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]
> [email protected] start /usr/src/ghost
> node index
Migrations: Creating database backup
ERROR: select count(distinct posts.id) as aggregate from "posts" where "posts"."visibility" = 'public' and "posts"."page" = true and "posts"."status" = 'published' - SQLITE_ERROR: no such column: posts.visibility
Error: select count(distinct posts.id) as aggregate from "posts" where "posts"."visibility" = 'public' and "posts"."page" = true and "posts"."status" = 'published' - SQLITE_ERROR: no such column: posts.visibility
at Error (native)
npm info poststart [email protected]
npm info ok
What went wrong and how should i upgrade this?
Question for releases in general.
When should we see this Dockerfile
updated after the Ghost Foundation released something on their side? Per example this commit: TryGhost/Ghost@e203eb8
I'm running 0.7.9 and I can't wait to see 0.9 !! I'm asking this with gratitude, not as a request :)
Cheers!
Pascal
With the transition from dockerfile/ghost, the official containers on Docker Hub no longer support the "ghost-override".
What is the recommended method to have user data outside of the container for easy backup?
Hi,
We currently have no way of persisting the config.*.json files in /var/lib/ghost. The only volume we can mount is /var/lib/ghost/content. Upstream ghost has not implemented a custom config file location option, with either a command-line argument or environment variable.
What I propose is two (or three) different methods:
ENV and Symbolic link
GHOST_CONFIG
that optionally contains a path to a config file, e.g. /config/config.production.json
ln -fs $GHOST_CONFIG /var/lib/ghost/GHOST_CONFIG
Volume and Symbolic link
a.
/config
/config/config.*.json
to /var/lib/ghost/config.*.json
ln -fs /config/config.*.json /var/lib/ghost/config.*.json
b.
/var/lib/ghost/content/config.*.json
to /var/lib/ghost/config.*.json
ln -fs /var/lib/ghost/content/config.*.json /var/lib/ghost/config.*.json
My favorite method would be 2a. This enables users of both docker compose and kubernetes to manage their config files. Docker compose can just mount another volume, and kubernetes users can make use of ConfigMaps and mount them in their own dedicated directory.
I would gladly submit a pull request, but i'm unsure if I should make edits to each version of ghost (1.0-1.5) or just the latest (1.5). All we'd have to do is add some code to the entrypoint.sh and an ENV + VOLUME clause to the Dockerfile.
When I go to /ghost
and try to sign up with a new build of this image the page loads, but it fails when I submit the page.
Here is the log from ghost:
GET /ghost/api/v0.1/authentication/setup/ 200 15.310 ms - 28
/usr/src/ghost/core/server/mail.js:95
if (data.error.errno === 'ENOTFOUND') {
^
TypeError: Cannot read property 'errno' of null
at EventEmitter.<anonymous> (/usr/src/ghost/core/server/mail.js:95:31)
at EventEmitter.g (events.js:180:16)
at EventEmitter.emit (events.js:95:17)
at DirectMailer.<anonymous> (/usr/src/ghost/node_modules/nodemailer/node_modules/directmail/lib/mailer.js:138:30)
at asyncCallback (dns.js:68:16)
at Object.onanswer [as oncomplete] (dns.js:147:9)
npm ERR! Linux 3.18.5-tinycore64
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.10.36
npm ERR! npm v2.7.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node index`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script 'node index'.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get their info via:
npm ERR! npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! Linux 3.18.5-tinycore64
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.10.36
npm ERR! npm v2.7.0
npm ERR! Uncaught, unspecified "error" event.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/ghost/npm-debug.log
I'm going to start looking at additional setup required from Ghost, but if there is any required, it seems like this should be mentioned in the readme.
I'm just running it as apart of my docker-compose
:
ghost:
image: ghost:0.5.9
ports:
- "8080:2368"
I believe we should use node6 as the image base.
Ghost no longer supports Node.js v0.12. It's is no longer maintained as of 31st December 2016. We will continue to recommend using Node v4 with Ghost for the time being - even that this version is not the version recommended for most users by Node.js, it's v6.
The readme says:
You can also point the image to your existing content on your host:
docker run --name some-ghost -v /path/to/ghost/blog:/var/lib/ghost ghost
If I run that exact command (substituting /path/to/ghost/bog for something real), the command fails:
docker run --name some-ghost -v $(pwd):/var/lib/ghost ghost
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]
> [email protected] start /usr/src/ghost
> node index
ERROR: Unable to access Ghost's content path:
EACCES: permission denied, open '/var/lib/ghost/apps/1ac067e9c982125d'
Check that the content path exists and file system permissions are correct.
Help and documentation can be found at http://support.ghost.org.
If you run it in an empty directory, it does populate with a config.js file, images/, themes/, data/, and apps/, though.
Because of the localhost:2368 in the dockerfile, its bad...
let us use a ENV where we can set the URL.
Ghost have handlers for SIGTERM and SIGINT.It is work in server.However,npm break the forward of SIGTERM in Docker container.
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 1 2.1 2.5 1076200 52648 ? Ssl 02:17 0:00 npm
user 39 0.0 0.0 4340 764 ? S 02:17 0:00 sh -c node index
user 40 13.5 5.5 1251604 113132 ? Sl 02:17 0:03 node index
root 49 1.5 0.1 20228 3008 ? Ss 02:18 0:00 /bin/bash
root 54 0.0 0.1 17500 2140 ? R+ 02:18 0:00 ps aux
npm is the process which PID is 1,it can't forward SIGTERM to node process.when I type docker stop ghost
to close the container,it will last 10 seconds then send the SIGKILL to close the container rudely.
Would it is helpful that using node index
instead of using npm start
I don't understand how I could work with persistent date if I cannot create directories and so on (e.g. adding a theme or updating it).
Configuration:
Steps:
mkdir /home/postblue/some-ghost
docker run --name some-ghost -d -p 80:2368 -e "VIRTUAL_HOST=some-ghost.example.tld" -v /home/postblue/some-ghost:/var/lib/ghost ghost
ls -l ghost
total 20
drwxr-xr-x 2 myroot root 4096 aoû 1 12:53 apps
drwxr-xr-x 2 myroot root 4096 aoû 1 12:54 data
drwxr-xr-x 2 myroot root 4096 aoû 1 12:53 images
drwxr-xr-x 3 myroot root 4096 aoû 1 12:53 themes
-rw-r--r-- 1 myroot root 3794 aoû 1 12:49 config.js
Digital Ocean one click ghost required $10 plan, Additionally, is there any guide to get this up and running on Digital Ocean.
Having a ghost image based from node 0.12-slim, i could have just one version of node image pulled from registry. Saves space on my machine too.
Can we have an official Ghost image based from node:0.12-slim?
I'm currently trying to get Ghost working on my Kubernetes cluster.
The main problem I'm having is that I can't load config.js
into the correct spot and while I can do/var/lib/ghost/content
Ghost blog is expecting a lot more files than the minimum stated by the README.
So two things:
config.js
file into /usr/src/ghost
/var/lib/ghost/
and if config.js
can also be put there?config.js
need to be changed since at the moment the default ones break because contentPath
and the db path aren't setup correctly for Docker setups.Seems like the new 0.10.0 Ghost version has not been pushed to the Docker repository. 👻
Do you need to tag the repo or simply update the repo details here:
https://github.com/docker-library/repo-info/blob/master/repos/ghost/tag-details.md
?
Thank you for any informations that you can provide to fix this issue 😅
Dockerfile:
FROM ghost:0.10.0
Output after docker build .
Step 1 : FROM ghost:0.10.0
Pulling repository docker.io/library/ghost
ERROR: Tag 0.10.0 not found in repository docker.io/library/ghost
Because #5 hasn't yet been merged, I attempted a manual workaround to run ghost
in a production environment.
$ docker run -d --name blog -p 2368:2368 -e "NODE_ENV=production" -v $PWD/docker/blog:/var/lib/ghost ghost
However, I'm seeing this:
For posterity's sake, here's my config.js
(manually adjusted to avoid the PATH
issue):
// # Ghost Configuration
// Setup your Ghost install for various environments
// Documentation can be found at http://support.ghost.org/config/
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://myurl.com/blog',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(process.env.GHOST_CONTENT, '/data/ghost.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '0.0.0.0',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
},
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blogs published URL.
url: 'http://localhost:2368',
// Example mail config
// Visit http://support.ghost.org/mail for instructions
// ```
// mail: {
// transport: 'SMTP',
// options: {
// service: 'Mailgun',
// auth: {
// user: '', // mailgun username
// pass: '' // mailgun password
// }
// }
// },
// ```
database: {
client: 'sqlite3',
connection: {
filename: path.join(process.env.GHOST_CONTENT, '/data/ghost-dev.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '0.0.0.0',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
paths: {
contentPath: path.join(process.env.GHOST_CONTENT, '/')
}
},
// **Developers only need to edit below here**
// ### Testing
// Used when developing Ghost to run tests and check the health of Ghost
// Uses a different port number
testing: {
url: 'http://0.0.0.0:2369',
database: {
client: 'sqlite3',
connection: {
filename: path.join(process.env.GHOST_CONTENT, '/data/ghost-test.db')
}
},
server: {
host: '0.0.0.0',
port: '2369'
},
logging: false
},
// ### Testing MySQL
// Used by Travis - Automated testing run through GitHub
'testing-mysql': {
url: 'http://0.0.0.0:2369',
database: {
client: 'mysql',
connection: {
host : '0.0.0.0',
user : 'root',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '0.0.0.0',
port: '2369'
},
logging: false
},
// ### Testing pg
// Used by Travis - Automated testing run through GitHub
'testing-pg': {
url: 'http://0.0.0.0:2369',
database: {
client: 'pg',
connection: {
host : '0.0.0.0',
user : 'postgres',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '0.0.0.0',
port: '2369'
},
logging: false
}
};
// Export config
module.exports = config;
Any ideas?
after making changes to theme or config.js, a reload of NPM is needed. Restarting the container does not apply the needed changes, and restarting NPM doesn't work either.
root@61583f8d0b57:/usr/src/ghost# npm restart npm info it worked if it ends with ok npm info using [email protected] npm info using [email protected] npm info prerestart [email protected] npm info prestop [email protected] npm info stop [email protected] npm info poststop [email protected] npm info restart [email protected] npm info prestart [email protected] npm info start [email protected] > [email protected] start /usr/src/ghost > node index using this config! GHOST_CONTENT: /var/lib/ghost GHOST_SOURCE: /usr/src/ghost ERROR: Cannot find the configuration for the current NODE_ENV: undefined Ensure your config.js has a section for the current NODE_ENV value and is formatted properly. npm info [email protected] Failed to exec start script npm ERR! Linux 3.19.0-43-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "restart" npm ERR! node v4.2.4 npm ERR! npm v2.14.12 npm ERR! code ELIFECYCLE npm ERR! [email protected] start: `node index` npm ERR! Exit status 232 npm ERR! npm ERR! Failed at the [email protected] start script 'node index'. npm ERR! This is most likely a problem with the ghost package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node index npm ERR! You can get their info via: npm ERR! npm owner ls ghost npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /usr/src/ghost/npm-debug.log
When running...
root@Ghost-Blog:~/projects/ghost-blog# docker run --name some-ghost -v $(pwd):/var/lib/ghost -p 80:2368 -e NODE_ENV=production library/ghost
> [email protected] start /usr/src/ghost
> node index
Migrations: Up to date at version 004
Ghost is running in production...
Your blog is now available on http://amilawelihinda.com
Ctrl+C to shut down
I am presented with the default ghost page. It seems as if my content directory is not being detected at all. But I know that it can read the config.js because it shows errors when validating it. I also know that the folder is getting mounted because i can run...
root@Ghost-Blog:~/projects/ghost-blog# docker exec -it some-ghost bash
root@cbfbf99fc983:/usr/src/ghost# ls
Gruntfile.js LICENSE PRIVACY.md README.md config.example.js config.js content core index.js node_modules npm-shrinkwrap.json package.json
root@cbfbf99fc983:/usr/src/ghost# cd /var/lib/ghost/
root@cbfbf99fc983:/var/lib/ghost# ls
Gruntfile.js PRIVACY.md config content data images kill.sh node_modules npm-shrinkwrap.json start.sh
LICENSE apps config.js core docker-compose.yml index.js mockups npm-debug.log package.json themes
This is the output of /var/lib/ghost/config.js...
production: {
url: 'http://amilawelihinda.com',
mail: {},
paths: {
contentPath: path.join(process.env.GHOST_CONTENT, '/')
// contentPath: path.join(__dirname, '/')
},
database: {
client: 'sqlite3',
connection: {
filename: path.join(GHOST_CONTENT, '/data/ghost.db')
},
debug: false
},
server: {
host: '0.0.0.0',
port: PORT
}
},
Hey guys, your entrypoint.sh is wrong, as it copies only folders and config.js is not properly copied . Then it checks if it exists, and replaces it with config.example.js . Of course it's not gonna be there since it only copies folders, so hence you cannot modify config.js at all
It has been noted here https://github.com/TryGhost/Ghost/wiki/Using-a-custom-storage-module that external storage can now be used with ghost but the official docker image (this project) does not come with this built-in.
Any plan to PLEASE help support this and include in official image?
Will really be one of the best features of 2017!
I just migrated my blogs running ghost 0.11.x to 1.5 with this image and i am afraid that making the config.production.json
permanent is not possible anymore.
One cannot bind a volume to /var/lib/ghost
anymore, otherwise ghost refuses to start since essential files and folders are missing. This makes it impossible to apply settings such as mail configuration permanently to the config-file.
Getting following error with 0.11.7. Works fine with 0.11.5.
$ docker run --name xyz-blog -v /data/xyz:/var/lib/ghost ghost
722...
$ docker logs 722...
module.js:327
throw err;
^
Error: Cannot find module 'ansi'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js:3:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
Seeing that Nginx is maintaining both (Ubuntu Jessie and Alpine), I started to use the Alpine lately.
Regarding this Ghost Dockerfile, I have to admit that I don't have the courage to convert the current Jessie image into an Alpine one.
Cheers!
I have tried the following with no success:
Here is the error when trying to 'docker run' the image:
[email protected] start /usr/src/ghost
node index
ERROR: Unable to access Ghost's content path:
EACCES, permission denied '/usr/src/ghost/content/apps/283e85be3ed7c1c0'
Check that the content path exists and file system permissions are correct.
Help and documentation can be found at http://support.ghost.org.
I've been using happily the dockerfile/ghost
image for quite a while but unfortunately due to some strange behaviour, I can't pull down that container anymore. This means I need to migrate to the official ghost image. I was thinking "great, now there's an official image, it must be great!" however I have to say that I'm getting disappointing results so far.
I can run a container just fine using the example commands in the README (which is for some strange reason decoupled from the actual images -- why?!) but when I am trying to run the app using the same parameters just with an extra environment variable passed down, the Ghost process quits:
attila@nl ~> docker run --name some-ghost -p 8082:2368 -d ghost
f7902e54918ef6e87fbd1102a3528328f33fa770f0fcae5718fc432ddbada79a
attila@nl ~> docker logs -f some-ghost
> [email protected] start /usr/src/ghost
> node index
Migrations: Database initialisation required for version 003
Migrations: Creating tables...
Migrations: Creating table: posts
Migrations: Creating table: users
Migrations: Creating table: roles
Migrations: Creating table: roles_users
Migrations: Creating table: permissions
Migrations: Creating table: permissions_users
Migrations: Creating table: permissions_roles
Migrations: Creating table: permissions_apps
Migrations: Creating table: settings
Migrations: Creating table: tags
Migrations: Creating table: posts_tags
Migrations: Creating table: apps
Migrations: Creating table: app_settings
Migrations: Creating table: app_fields
Migrations: Creating table: clients
Migrations: Creating table: accesstokens
Migrations: Creating table: refreshtokens
Migrations: Populating fixtures
Migrations: Populating permissions
Migrations: Creating owner
Migrations: Populating default settings
Migrations: Complete
Ghost is running in development...
Listening on 0.0.0.0:2368
Url configured as: http://localhost:2368
Ctrl+C to shut down
^C⏎
attila@nl ~> docker run --name some-ghost-with-an-env-var -e 'NODE_ENV=production' -p 8085:2368 -d ghost
612d06f8fce241acde7d0472c2f8349b4444150813a55eac1de8fde7fa2250d4
attila@nl ~> docker logs -f some-ghost-with-an-env-var
> [email protected] start /usr/src/ghost
> node index
ERROR: Unable to access Ghost's content path:
EACCES, permission denied '/usr/src/ghost/content/apps/80beac6151a281d1'
Check that the content path exists and file system permissions are correct.
Help and documentation can be found at http://support.ghost.org.
I would really appreciate any help as this is getting really disappointing. There isn't any instruction in the README on how to run the app in production.
I am using docker 1.6.2 on an Ubuntu host:
docker -v
Docker version 1.6.2, build 7c8fca2
Thank you.
Hi,
I was about to fork and submit a PR for Ghost/Ghost CLI updates. But I know the Docker team have good process to update all your official images on a regular base. So it made me wonder…
I see the docker-library-bot seems to catchup with Ghost updates (per example) but didn't catch the Ghost CLI update.
Ghost release shows 1.6.1
Ghost CLI release shows 1.1.0
I see that the Dockerfile for Ghost 1.6.0 was updated more than 24 hours ago, but in the docker hub tags the image is not there. Same story for 1.6.1
I want to know what would be the best way to contribute regarding Ghost future updates.
Cheers!
Pascal
I'm using a docker-compose file which starts my mysql and starts my ghost container.
This is one line in my docker-compose script:
entrypoint: ./wait-for-it.sh mysql -- ../../../entrypoint.sh -- npm start
So after the wait-for-it is successful I want to start the container but this is where it goes wrong.
When I don't use the wait-for-it script I have to perform docker-compose up --build -d
multiple times till mysql is ready and everything goes fine. My ghost is creating the tables in the mysql and I can access ghost in my browser.
But when I try to use the wait-for-it.sh and after that I execute the entrypointscript + npm start it goes wrong.
The logs of my ghost container looks fine:
Migrations: Creating table: client_trusted_domains
Migrations: Creating table: accesstokens
Migrations: Creating table: refreshtokens
Migrations: Creating table: subscribers
Migrations: Running fixture populations
Migrations: Creating owner
Ghost is running in development...
Listening on 127.0.0.1:2368
Url configured as: http://localhost:2368
Ctrl+C to shut down
But first of all the tables aren't created in my mysql. The second issue is the fact I can't access my ghost blog in my browser. I don't see any errors. I'm using tag 0.11.0 in docker 1.12.1.
So as long as I'm using this line in my docker-compose.yaml it does not work. When I comment this part I don't have a wait-for-it but everything works.
I tried to debug by performing the steps I want to perform manually but it seems not possible to restart the npm.
[root@localhost docker-ghost]# docker exec -it 4bad1fdcd942 bash
root@4bad1fdcd942:/usr/src/ghost# ./../../../e
entrypoint.sh etc/
root@4bad1fdcd942:/usr/src/ghost# ./../../../entrypoint.sh
root@4bad1fdcd942:/usr/src/ghost# npm restart
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prerestart [email protected]
npm info prestop [email protected]
npm info stop [email protected]
npm info poststop [email protected]
npm info restart [email protected]
npm info prestart [email protected]
npm info start [email protected]
> [email protected] start /usr/src/ghost
> node index
WARNING: Ghost is attempting to use a direct method to send email.
It is recommended that you explicitly configure an email service.
Help and documentation can be found at http://support.ghost.org/mail.
ERROR: (EADDRINUSE) Cannot start Ghost.
Port 2368 is already in use by another program.
Is another Ghost instance already running?
npm info [email protected] Failed to exec start script
npm ERR! Linux 3.10.0-229.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "restart"
npm ERR! node v4.6.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node index`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] start script 'node index'.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ghost
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/ghost/npm-debug.log
If I set NODE_ENV
to production in the container settings, I get this:
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]
> [email protected] start /usr/src/ghost
> node index
ERROR: Unable to access Ghost's content path:
EACCES: permission denied, open '/usr/src/ghost/content/apps/c7d97c8399fc41be'
Check that the content path exists and file system permissions are correct.
Help and documentation can be found at http://support.ghost.org.
npm info [email protected] Failed to exec start script
npm ERR! Linux 4.1.13-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.4
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node index`
npm ERR! Exit status 235
npm ERR!
npm ERR! Failed at the [email protected] start script 'node index'.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get their info via:
npm ERR! npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! Linux 4.1.13-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.4
npm ERR! npm v2.14.12
npm ERR! path npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/ghost/npm-debug.log
This could be documented.
See related issue:
docker-library/official-images#1487 (comment)
Hi.
The current Readme for the image specifies that you should mount the /var/lib/ghost/content
folder.
However, /var/lib/ghost/content/themes/casper
is a link to somewhere else in the container, which means you can't mount files to there.
Is there a recommended way to mount files to effect the casper theme?
Thanks.
I just used the docs to run an official Ghost image on my computer, but after I get through step two of my blog setup, I get this message at the bottom and cannot move any further
"Access Denied from url: 10.0.1.13. Please use the url configured in config.js"
That is the current url of my docker machine. Any idea on how to fix this?
I've tried both with Mailgun and Sengrid and I keep getting these errors when I try to send an invitation email:
Mailgun:
Warning: Error sending email: Error: getaddrinfo ENOTFOUND smtp.mailgun.org smtp.mailgun.org:587 Please check your email settings and resend the invitation.
Sendgrid:
Warning: Error sending email: Error: getaddrinfo ENOTFOUND smpt.sendgrid.net smpt.sendgrid.net:587 Please check your email settings and resend the invitation.
No other errors appear in the logs. I also tried disabling UFW and trying again, but it still would not work. I'm running the docker image on a Digital Ocean droplet, which is running Ubuntu 14.04. I didn't have an issue when I first set up Ghost and received the email to set up my account. The only significant event I can think of since then was having to shut down the Digital Ocean droplet to take a snapshot, but the rest of the blog and my other docker containers are working fine.
This is new in Ghost v1
I feel this is overkill for most installations. In 7 days, the size of my logs in prod is about 140 MO.
@acburdine can you points us to some docs about the level of the log we can collect?
I looked in https://docs.ghost.org/v1.0.0/docs/cli-log#section-options and there is no mention of this.
Cheers!
Pascal
I am currently running the official 0.11.3 ghost image on my local OSx machine.
I am running only the official ghost image with no proxies etc and mapping my theme folder and config file into the container using volumes. Everything works, but Ghost acts like it's in production mode even though it says it is in development mode on startup.
I am passing NODE_ENV = development as an environmental variable and using a Ghost config.js file that DOES NOT have a production server / host block (ie. it would error out if NODE_ENV was anything other than "development")
I am able to access the blog / theme and everything runs properly in my browser EXCEPT when I make a change to my Theme files. That change is then not reflected when I refresh my browser.
Further, if I restart my Ghost container, the change is still not visible even after waiting for the container to restart and again reloading the page. In order to see the changes visible I have to kill the current container and spin up a new one.
On start up Ghost indicates:
+++++
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]
[email protected] start /usr/src/ghost
node index
Starting Ghost using DEVELOPMENT config... :) #added echo in my config file
NODE_ENV = development... :) #added echo in my config file
+++++
and then finally....
"Ghost is running in development... "
+++++
At some point I had all of this working in the distant past.
#1. Add a line to config file to echo the current NODE_ENV value,
Result: Echos NODE_ENV = development on startup
#2. Docker Exec -it into Ghost container to check to make sure the edited files are in fact flowing through into the container by editing them from within the container using vim.
Result: Changed files are up to date inside of the container.
#3. Docker Exec -it into Ghost container to kill node process / attempt to restart
**Result: Container dies / exits with:
Ghost was running for 8 minutes
npm info poststart [email protected]
npm info ok
#4. Pull down Ghost:0.11 image to use instead of 0.11.3
Result: No Change, same issue.
I am not using VirtualBox so some of the issues related to volumes and sendfile are probably not relevant.
I am on MacOS using Docker for Mac 1.12.3, with the latest version of the ghost image from docker hub. I am using a remote mysql db and my fingers are bleeding from two days of googling around for trouble shooting ideas, hopefully you guys have some.
I'm very new to Ghost so my assumptions may be way off base, but I have a few questions about this repo that if answered may prove useful in the README for newcomers.
My first question is why the installation of Ghost is not /var/www/ghost
which is the recommended installation location according to this article from Ghost support docs.
Also, I have a single theme located in a very basic folder structure ~/foo/ghost/content/themes/mytheme
. When I try to map the volume of /var/lib/ghost
to this folder using the given example: docker run --name some-ghost -v ~/foo/ghost/:/var/lib/ghost ghost
I would expect my theme to show up in the Settings dashboard. Is this because I don't provide my own config.js
? Is there a better way to include themes in the blog? When I enter into the running container I notice the structure is more /var/lib/ghost/themes
which completely bypasses the content
folder I would expect to see. Am I way off base here?
Ghost tags tried: latest
, 0.11.7
(equivalent tags)
Docker version: v17.03.0-ce
OS: macOS
Type: docker-machine
All cases start with an empty directory
$ docker run --rm --name myblog -p 8080:2368 -it -v $(pwd):/var/lib/ghost:rw ghost:latest
mkdir: cannot create directory '/var/lib/ghost/apps/': Permission denied
$ docker run --rm --name myblog -p 8080:2368 -it -v $(pwd):/var/lib/ghost:rw ghost:0.11.7 bash
root@9acbe98bd181:/usr/src/ghost# npm start
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
...
> [email protected] start /usr/src/ghost
> node index
...
ERROR: SQLITE_CANTOPEN: unable to open database file
Error: SQLITE_CANTOPEN: unable to open database file
at Error (native)
npm info poststart [email protected]
npm info ok
root@9acbe98bd181:/usr/src/ghost# /entrypoint.sh npm start
mkdir: cannot create directory '/var/lib/ghost/apps/': Permission denied
--user
. As per Dockerfile
, ghost
image uses a user called user
$ docker run --rm --name myblog -p 8080:2368 -it --user="user" -v $(pwd):/var/lib/ghost:rw ghost:0.11.7
mkdir: cannot create directory '/var/lib/ghost/apps/': Permission denied
$ docker run --rm --name myblog -p 8080:2368 -it ghost:0.11.7
npm info it worked if it ends with ok
...
> [email protected] start /usr/src/ghost
> node index
...
Migrations: Creating tables...
...
Migrations: Creating owner
Ghost is running in development...
...
Ctrl+C to shut down
entrypoint.sh
]$ docker run --rm --name myblog -p 8080:2368 -it -v $(pwd):/var/lib/ghost:rw ghost:0.11.7 bash
root@cfe4b0069a1a:/usr/src/ghost# baseDir="$GHOST_SOURCE/content"
root@cfe4b0069a1a:/usr/src/ghost# for dir in "$baseDir"/*/ "$baseDir"/themes/*/; do
> targetDir="$GHOST_CONTENT/${dir#$baseDir/}"
> mkdir -p "$targetDir"
> if [ -z "$(ls -A "$targetDir")" ]; then
> tar -c --one-file-system -C "$dir" . | tar xC "$targetDir"
> fi
> done
root@cfe4b0069a1a:/usr/src/ghost#
root@cfe4b0069a1a:/usr/src/ghost# if [ ! -e "$GHOST_CONTENT/config.js" ]; then
> sed -r '
> s/127\.0\.0\.1/0.0.0.0/g;
> s!path.join\(__dirname, (.)/content!path.join(process.env.GHOST_CONTENT, \1!g;
> ' "$GHOST_SOURCE/config.example.js" > "$GHOST_CONTENT/config.js"
> fi
root@cfe4b0069a1a:/usr/src/ghost# npm start
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
...
> [email protected] start /usr/src/ghost
> node index
...
Migrations: Creating tables...
...
Ghost is running in development...
Listening on 0.0.0.0:2368
Url configured as: http://localhost:2368
Ctrl+C to shut down
pwd
$ docker run --rm --name myblog -p 8080:2368 -it -v $(pwd):/var/lib/ghost:rw ghost:0.11.7 bash
root@fc4a80a12525:/usr/src/ghost# npm start
npm info it worked if it ends with ok
...
> [email protected] start /usr/src/ghost
> node index
WARNING: Ghost is attempting to use a direct method to send email.
...
Ghost is running in development...
...
Ctrl+C to shut down
Note: Running
$ docker run --rm --name myblog -p 8080:2368 -it -v $(pwd):/var/lib/ghost:rw ghost:0.11.7 npm start
(or without any args) instead of (3) doesn't work. I have to run bash
and then run npm start
I am at loss for an explanation as to why the cases that work do work, and the cases that don't, don't. This is voodoo stuff.
regarding #73 i configured the container with an environment variable
URL=https://example.com/
After startup (removed old container) the generated links on the page (tags, rss) still show http://localhost:2368.
Also the startup messages say
Your blog is now available on http://localhost:2368/
executing a shell in the container shows the environment variable though
# env
GHOST_INSTALL=/var/lib/ghost
NODE_VERSION=6.11.2
HOSTNAME=39c60a570f9e
TERM=xterm
VIRTUAL_PORT=2368
NPM_CONFIG_LOGLEVEL=warn
GHOST_VERSION=1.5.0
GHOST_CONTENT=/var/lib/ghost/content
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/var/lib/ghost
NODE_ENV=production
URL=https://example.com/
I would like to know why you don't integrate sendmail service to docker ghost container. It will help you to minimize the config modification.
You can integrate this in your config.
mail: {
transport: 'SMTP',
options: {service: 'sendmail',}
},
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?
Hi,
I'm using the Ghost container on a Synology NAS. First time starting the container works fine, but when I restart the container, ghost wont run. When I use ghost start, I get the error as below
root@ghost2:/var/lib/ghost# ghost start
✖ Validating config
A ConfigError occurred.
Error detected in the production configuration.
Message: Port '2368' is in use.
Configuration Key(s): server.port
Current Value(s): 2368
Help: Run `ghost config <key> <new value>` for each key to fix the issue.
Debug Information:
Node Version: v6.11.2
Ghost-CLI Version: 1.1.1
Environment: production
Command: 'ghost start'
Please refer to https://docs.ghost.org/v1/docs/troubleshooting#section-cli-errors for troubleshooting.
root@ghost2:/var/lib/ghost#
I haven't changed anything after the initial installation.
Tried multiple times, but every time I get this.
Used the most recent image.
Hope someone can help me :)
Thanks
Björn
i see too many tutorials ALWAYS defaulting everything to development. WHY it is this way is beyond my understanding.
Where in the documentation does it explain how to run this in PRODUCTION?
When i run the container by default without any environment variables, it works fine until i actually want to get it working in PRODUCTION with the NODE_ENV=production
then its a failure
Any way to include documentation of the PRODUCTION environment? or even default this to production and the other way around, to specify env to use development???
Something really weird happened with my Ghost container.
I dismissed the update notification and got this
Failed to load resource: the server responded with a status of 403 (Forbidden)
vendor.js?v=638cdc5f90:45884Error: Ember Data Request DELETE http://blog.mydomain.com/ghost/api/v0.1/notifications/1/ returned a 403
Payload (application/json; charset=utf-8)
[object Object]
at AdapterError.EmberError (vendor.js?v=638cdc5f90:30213)
at AdapterError (vendor.js?v=638cdc5f90:185906)
at Class.handleResponse (vendor.js?v=638cdc5f90:187189)
at Class.handleResponse (vendor.js?v=638cdc5f90:203072)
at Class.superWrapper (vendor.js?v=638cdc5f90:36827)
at Class.handleResponse (ghost.js?v=638cdc5f90:64)
at Class.superWrapper [as handleResponse] (vendor.js?v=638cdc5f90:36827)
at ajaxError (vendor.js?v=638cdc5f90:187687)
at Class.hash.error (vendor.js?v=638cdc5f90:187261)
at fire (vendor.js?v=638cdc5f90:7912)onerrorDefault @ vendor.js?v=638cdc5f90:45884trigger @ vendor.js?v=638cdc5f90:66627(anonymous function) @ vendor.js?v=638cdc5f90:67878invoke @ vendor.js?v=638cdc5f90:14873flush @ vendor.js?v=638cdc5f90:14937flush @ vendor.js?v=638cdc5f90:14745end @ vendor.js?v=638cdc5f90:15100run @ vendor.js?v=638cdc5f90:15222join @ vendor.js?v=638cdc5f90:15242run.join @ vendor.js?v=638cdc5f90:34853hash.error @ vendor.js?v=638cdc5f90:187262fire @ vendor.js?v=638cdc5f90:7912fireWith @ vendor.js?v=638cdc5f90:8042done @ vendor.js?v=638cdc5f90:13484(anonymous function) @ vendor.js?v=638cdc5f90:13848
My only config changes
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blog's published URL.
url: 'http://blog.mydomain.com'
I'm using:
Docker:
Client:
Version: 1.12.2
API version: 1.24
Go version: go1.6.3
Git commit: bb80604
Built: Tue Oct 11 18:29:41 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.2
API version: 1.24
Go version: go1.6.3
Git commit: bb80604
Built: Tue Oct 11 18:29:41 2016
OS/Arch: linux/amd64
allow to set headers officially on expressjs which powers the ghost application
Why?
In the world of microservices, it is best to set response headers right from the source(application)
will be great to be able to set HTTP headers right from running ghost container which is powered by expressjs so one can troubleshoot at the microservices layer.
How?
For now,
It looks like hard coded with sqlite3 in the Dockerfile
.
Would it be faster if we split the installation of Build deps into a RUN
and another for the curl
of lates Ghost version?
https://github.com/docker-library/ghost/blob/master/Dockerfile#L33
The current setup is ok but builds a little slowly for mine on an armhf device. Just though it might be worth discussing/bringing this up as an improvement!
gpg: keyring /tmp/tmp.Le9rzhBiPt/secring.gpg' created gpg: keyring
/tmp/tmp.Le9rzhBiPt/pubring.gpg' created
gpg: requesting key BF357DD4 from hkp server ha.pool.sks-keyservers.net
?: ha.pool.sks-keyservers.net: Network is unreachable
gpgkeys: HTTP fetch error 7: couldn't connect: Network is unreachable
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
What's this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.