Git Product home page Git Product logo

docker-for-hexo's Introduction

docker-for-hexo

Docker Automated build Docker Build Status Docker Pulls MicroBadger Layers

一个轻量级的hexo docker镜像。

快速开始

  1. 拉取镜像
docker pull leebroncc/hexo
  1. 创建一个server容器并运行
docker run -p 4000:4000 --name hexo-server -d \
-v {本地博客路径}/source:/hexo/source \
-v {本地博客路径}/themes:/hexo/themes \
-v {本地博客路径}/_config.yml:/hexo/_config.yml \
leebroncc/hexo s

{本地博客路径}为你的宿主机的hexo容器共享目录,这个目录是绝对路径

  1. 访问http://ip:4000即可访问博客

部署

部署的前提是:

  • 已经拉取了镜像
  • _config.yml已经配置正确
  • 宿主机需要安装git
docker run -p 4000:4000 --name hexo-server -d \
-v {本地ssh目录}/.ssh:/root/.ssh \
-v {本地博客路径}/source:/hexo/source \
-v {本地博客路径}/themes:/hexo/themes \
-v {本地博客路径}/_config.yml:/hexo/_config.yml \
-e USER_NAME="{github用户名}" \
-e USER_EMAIL="{github邮箱}" \
leebroncc/hexo d

即可部署成功。

如何构建本镜像

  1. 下载源码
git clone https://github.com/leonGravel/docker-for-hexo.git
  1. 构建镜像
cd docker-for-hexo
docker bulid -t hexo .

docker-for-hexo's People

Contributors

leongravel avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.