docker chrome 镜像制作

1.构建基础镜像

docker build -f Dockerfile -t mycentos:0.1 .

FROM centos:7
MAINTAINER wuming@herogo.com
RUN yum install -y wget  net-tools iproute bind-utils lrzsz \
    && rm -rf /var/cache /tmp/* \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 \
    && yum install kde-l10n-Chinese -y \
    && yum install glibc-common -y \
    && export LANG=zh_CN.UTF-8 \
    && echo "export LC_ALL=zh_CN.utf8" >> /etc/profile \
    && echo "export LANG=zh_CN.UTF-8" >> /etc/locale.conf \
    && echo "export LC_ALL=zh_CN.UTF-8" >> ~/.bashrc \
    && echo "export LANGUAGE=zh_CN.UTF-8" >> ~/.bashrc \
    && echo "export LANG=zh_CN.UTF-8" >> ~/.bashrc \
    && source ~/.bashrc \
    && source /etc/profile \
    && source /etc/locale.conf \
    && localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
ENV LC_ALL zh_CN.UTF-8
WORKDIR /user/work

2.在基础镜像里 安装chrome和中文字体包

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum install google-chrome-stable_current_x86_64.rpm
yum -y install mkfontscale
复制字体到 /usr/share/fonts/
mkfontscale
mkfontdir
fc-cache

3.使用docker commit 提交镜像

docker commit -m ‘镜像描述’ -a ‘制作者’ 容器名 镜像名
docker tag xxx private-registry.xxxx.com/devops/xxx
docker push private-registry.xxxx.com/devops/xxx

你可能感兴趣的:(docker,运维,容器)