-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
78 lines (63 loc) · 2.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
USER root
ENV DEBIAN_FRONTEND noninteractive
ENV WINEDEBUG fixme-all
ENV WINEPREFIX /opt/pywine
ARG APT_FLAGS="-y -qq --no-install-recommends --no-install-suggests"
ARG CORE_PACKAGES="\
cabextract \
procps \
"
ARG USER=cloud
ARG WORKDIR=/install
RUN mkdir -p /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix \
&& chown root /tmp/.X11-unix
RUN apt-get update ${APT_FLAGS} \
&& apt-get install ${APT_FLAGS} ${CORE_PACKAGES} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash ${USER}
RUN mkdir -p ${WINEPREFIX} \
&& chown -R ${USER}:${USER} ${WINEPREFIX}
USER ${USER}
WORKDIR ${WORKDIR}
RUN winetricks win10
ADD scripts/initdll.sh .
RUN sh ./initdll.sh \
&& rm initdll.sh
ARG PY_VERSION
ARG PY_INSTALL_URL="https://www.python.org/ftp/python/${PY_VERSION}/python-${PY_VERSION}-amd64.exe"
RUN curl -sL ${PY_INSTALL_URL} | install /dev/stdin python.exe \
&& xvfb-run sh -c "\
wine ./python.exe /quiet Include_doc=0 InstallAllUsers=1 PrependPath=1; \
wineserver -w" \
&& rm python.exe
RUN xvfb-run sh -c "\
wine python -m pip install --upgrade pip; \
wineserver -w"
USER root
COPY ./scripts/entrypoint.sh /opt/entrypoint
RUN chmod a+x /opt/entrypoint
ENTRYPOINT ["/opt/entrypoint"]
WORKDIR /home/${USER}
RUN rm -rf ${WORKDIR}
ENV WINEDEBUG -all
USER ${USER}
ARG CREATED_DATE
ARG REFNAME
ARG REPOSITORY
LABEL org.opencontainers.image.authors="Richard 'Sylver' Kemp <[email protected]>"
LABEL org.opencontainers.image.created=${CREATED_DATE}
LABEL org.opencontainers.image.description="Image containing a wine headless prefix with Python ${PY_VERSION} installed."
LABEL org.opencontainers.image.documentation="${REPOSITORY}/specs/pywine"
LABEL org.opencontainers.image.licenses="GPL-3.0-only"
LABEL org.opencontainers.image.ref.name=${REFNAME}
LABEL org.opencontainers.image.revision=
LABEL org.opencontainers.image.source=${REPOSITORY}
LABEL org.opencontainers.image.title="Headless Wine prefix for Python."
LABEL org.opencontainers.image.url="${REPOSITORY}/specs/pywine"
LABEL org.opencontainers.image.vendor="Materya"
LABEL org.opencontainers.image.version=${PY_VERSION}
CMD ["/bin/bash"]