Home Archives Categories Tags

构建jekyll镜像

发布时间: 更新时间: 总字数:307 阅读时间:1m 作者: 分享

因为github无耻的拒绝了百度对gitpage的抓取和收录,故此自己只做了个jekyll环境跑gitpage的blog,只为收录。。。

Dockerfile

# Create by Xie Xianbin, For Jekyll Dockerfile 
# v 0.0.1

# base image 
FROM xiexianbin/centos6:base

# remark 
MAINTAINER Xie Xianbin "xianbinxie@163.com"

# Dockerfile build cache 
ENV REFRESHED_AT 2015-11-29

# for base env
RUN rm -rf /etc/yum.repos.d/*
COPY Centos-6.repo /etc/yum.repos.d/
RUN rpm -ivh http://mirrors.zju.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm
RUN yum clean all
RUN yum -y install gcc git wget curl vim tar

# for jekyll env
RUN yum install nodejs libyaml -y
COPY ruby-1.9.3p545-1.el6.x86_64.rpm /opt/

RUN rpm -ivh /opt/ruby-1.9.3p545-1.el6.x86_64.rpm
RUN rm -rf /opt/ruby-1.9.3p545-1.el6.x86_64.rpm
RUN gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
RUN gem install jekyll --version "=1.4.2"
RUN gem install kramdown

RUN yum clean all
RUN history -c

EXPOSE 8080
ENTRYPOINT ["/bin/bash"]

Dockerfile 目录文件详情

[root@xianbin docker]# pwd
/root/docker/docker
[root@xianbin docker]# ll
total 18660
-rw-r--r-- 1 root root     2572 Nov 30 01:18 Centos-6.repo
-rw-r--r-- 1 root root      823 Nov 30 01:18 Dockerfile
-rw-r--r-- 1 root root 19098152 Nov 30 01:21 ruby-1.9.3p545-1.el6.x86_64.rpm

Docker相关文件下载地址:http://pan.baidu.com/s/1o6J7UDc

Docker build 命令

docker build -t xiexianbin/centos6:jekyll .

登录Docker Hub

[root@iZ288u02izdZ ~]# docker login
Username: xiexianbin
Password: 
Email: me@xiexianbin.cn
WARNING: login credentials saved in /root/.dockercfg.
Login Succeeded
[root@iZ288u02izdZ ~]# 

docker push

docker push xiexianbin/centos6:jekyll
最新评论
加载中...