You can use this image just like the hexo-cli, for example:
docker run --rm davyyy/hexo help
The commands hexo init and npm install already ran when built the docker image,
so you don't have to download anything to start.
docker run --name hexo-server -d -p YOURPORT:4000 -v /YOUR/BLOG/PATH/:/blog davyyy/hexo server
Notes:
volumes-from.-d option.The /YOUR/BLOG/PATH/ shoud be empty(or not exists) when first run container from this image.
If the directory is empty, it will copy all init files from the image to the volume, otherwise do nothing.
And you can run hexo init command by yourself if you like, of course.
docker run --rm --volumes-from hexo-server davyyy/hexo new foo
INFO Created: /blog/source/_posts/foo.md
Then you can write your post with your favorite editer, for example:
vim /YOUR/BLOG/PATH/source/_posts/foo.md
Just remember:
--rm option to remove it automatically.--volumes-from to mount from our earlier created blog volume, otherwise it will create a new volume with initial hexo.docker run --rm --volumes-from hexo-server davyyy/hexo gen
docker run --rm --volumes-from hexo-server davyyy/hexo deploy
Content type
Image
Digest
Size
266.9 MB
Last updated
almost 9 years ago
docker pull davyyy/hexo