1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#基于node:6.11.3-alpine基础镜像
FROM node:6.11.3-alpine

LABEL version="0.3" maintainer="abc@tolcol.com"

RUN apk update && \
apk add git && \
mkdir /home/hexo && \
npm install -g hexo-cli && \
npm install -g hexo-server

WORKDIR /home/hexo

RUN hexo init blog && \
cd blog && \
npm install

WORKDIR /home/hexo/blog

CMD [ "hexo","server" ]

#构建命令

1
$ docker build -t myhexo:1.0 .