步骤1: 搭建基础层layer0,编写layer0的Dockerfile文件

FROM ubuntu:16.04

MAINTAINER ql

RUN DEBIAN_FRONTEND=noninteractive \

&& apt-get update \

&& apt-get install -y wget \

&& apt-get install -y software-properties-common python-software-properties \

&& apt-get install -y apt-transport-https \

&& dpkg --add-architecture i386 \

&& wget https://dl.winehq.org/wine-builds/Release.key \

&& apt-key add Release.key \

&& add-apt-repository https://dl.winehq.org/wine-builds/ubuntu/ \

&& apt-get update \

&& apt-get install -y --install-recommends winehq-stable \

&& apt-get install -y winetricks \

&& apt-get -y autoremove \

&& apt-get clean \

&& rm -rf /var/lib/apt/lists/* \

 

docker build -t ql/wine:l0

 

步骤2: 搭建用户层layer1,编写用户层的Dockerfile文件

FROM ql/wine:l0

MAINTAINER ql

ENV _USER=ubuntu

ENV _GROUP=ubuntu

ENV _UID=1000

ENV _GID=100

RUN mkdir /home/${_USER} \

#&& mkdir ubuntu \

#&& cd /home/${_USER} \

&& mkdir /home/${_USER}/.wine \

&& echo "${_USER}:x:${_UID}:${_GID}:${_GROUP},,,:/home/${_USER}:/bin/bash" >> /etc/passwd \

&& echo "${_GROUP}:x:${_UID}:" >> /etc/group \

&& echo "${_USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${_USER} \

&& chmod 0440 /etc/sudoers.d/${_USER} \

&& chown ${_USER}:${_GROUP} -R /home/${_USER}

USER ${_USER}

ENV HOME /home/${_USER}

WORKDIR $HOME

 

docker build -t ql/wine:l1

 

搭建layer2,编写layer2的Dockerfile文件,下载msxml3.msi复制进去

FROM atom/wine:l1

MAINTAINER ql

COPY msxml3.msi /home/Ubuntu

 

docker build -t ql/wine:l2 .

 

wine的基础镜像到此搭建完毕,可以根据实际应用,在此镜像上进行搭建其他镜像。

Logo

更多推荐