Skip to content

RammusXu/docker-hexo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Before you run commands below, remember to replace -v /Users/rammus/workspace/rammusxu.github.io:/blog to yourself project path.

First Run

Mount your hexo project and install dependent packages.

docker run --rm --name hexo \
    -p 4000:4000 \
    -v /Users/rammus/workspace/rammusxu.github.io:/blog \
    rammusxu/docker-hexo install

Start Server - For Debug

Test command, then remove the container.

docker run --rm --name hexo \
    -p 4000:4000 \
    -v /Users/rammus/workspace/rammusxu.github.io:/blog \
    rammusxu/docker-hexo

Start Server

Start server in background.

docker run -d --name hexo \
    -p 4000:4000 \
    -v /Users/rammus/workspace/rammusxu.github.io:/blog \
    rammusxu/docker-hexo

Deploy

Deploy to git, you must set GIT_EMAIL and GIT_NAME

docker run --rm \
    -e GIT_EMAIL="comte_ken@hotmail.com" \
    -e GIT_NAME="Rammus Xu" \
    -v "/Users/rammus/.ssh:/root/.ssh" \
    -v "$PWD":/blog \
    rammusxu/docker-hexo deploy

Run Other Commands

You can execute other command after rammusxu/docker-hexo.

docker run --rm --name hexo \
    -p 4000:4000 \
    -v /Users/rammus/workspace/rammusxu.github.io:/blog \
    rammusxu/docker-hexo hexo help