-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
77 lines (62 loc) · 2.66 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
############
# OS setup #
############
FROM ubuntu:18.04
MAINTAINER Patrick Pedrioli
LABEL Description="A basic wine container with support for X11 forwarding and user matching between host-image" Version="1.1"
## Let apt-get know we are running in noninteractive mode
ENV DEBIAN_FRONTEND noninteractive
## Make sure image is up-to-date
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install wget gnupg
##############
# Wine setup #
##############
## Enable 32 bit architecture for 64 bit systems
RUN dpkg --add-architecture i386
## Add wine repository
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN wget -qO- https://dl.winehq.org/wine-builds/Release.key | apt-key add -
RUN apt-get -y install software-properties-common \
&& add-apt-repository 'deb http://dl.winehq.org/wine-builds/ubuntu/ bionic main' \
&& apt-get update
## Install wine and winetricks
RUN apt-get -y install --install-recommends winehq-devel cabextract
#RUN apt-get -y install --install-recommends wine1.7
## Setup GOSU to match user and group ids
##
## User: user
## Pass: 123
##
## Note that this setup also relies on entrypoint.sh
## Set LOCAL_USER_ID as an ENV variable at launch or the default uid 9001 will be used
## Set LOCAL_GROUP_ID as an ENV variable at launch or the default uid 250 will be used
## (e.g. docker run -e LOCAL_USER_ID=151149 ....)
##
## Initial password for user will be 123
ENV GOSU_VERSION 1.9
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true
ENV USER_ID 9001
ENV GROUP_ID 255361
RUN addgroup --gid $GROUP_ID userg
RUN useradd --shell /bin/bash -u $USER_ID -g $GROUP_ID -o -c "" -m user
ENV HOME /home/user
RUN chown -R user:userg $HOME
RUN echo 'user:123' | chpasswd
ENV WINEPREFIX /home/user
## Make sure the user inside the docker has the same ID as the user outside
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 755 /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]