-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
95 lines (77 loc) · 2.28 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM ubuntu:16.04
LABEL maintainer="paduel@gmail.com"
WORKDIR /tmp/
RUN set -ex; \
dpkg --add-architecture i386; \
DEBIAN_FRONTEND=noninteractive apt-get update -y; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apt-transport-https \
binutils \
cabextract \
curl \
# To take screenshots of Xvfb display
imagemagick \
p7zip \
software-properties-common \
wget \
unzip \
xz-utils \
xvfb \
fluxbox \
x11vnc
RUN set -ex; \
wget https://dl.winehq.org/wine-builds/Release.key; \
apt-key add Release.key; \
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/; \
DEBIAN_FRONTEND=noninteractive apt-get update -y; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --install-recommends \
winehq-stable --allow-unauthenticated; \
rm Release.key
RUN set -ex; \
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks; \
chmod +x winetricks; \
mv winetricks /usr/local/bin
COPY waitonprocess.sh /docker/
RUN chmod a+rx /docker/waitonprocess.sh
ARG USER=winer
ARG HOME=/home/$USER
ARG USER_ID=1000
# To access the values from children containers.
ENV USER=$USER \
HOME=$HOME
RUN set -ex; \
groupadd $USER;\
useradd -u $USER_ID -d $HOME -g $USER -ms /bin/bash $USER
USER $USER
ENV WINEARCH=win32 \
WINEPREFIX=$HOME/.wine \
DISPLAY=:1 \
SCREEN_NUM=0 \
SCREEN_WHD=1366x768x24
ENV MT4DIR=$WINEPREFIX/drive_c/mt4
ADD cache $HOME/.cache
USER root
RUN chown $USER:$USER -R $HOME/.cache
USER $USER
RUN set -ex; \
wine wineboot --init; \
/docker/waitonprocess.sh wineserver; \
winetricks --unattended dotnet40; \
/docker/waitonprocess.sh wineserver
# Download gecko and mono installers
USER root
COPY download_gecko_and_mono.sh /root/download_gecko_and_mono.sh
RUN set -e; \
chmod a+rx /root/download_gecko_and_mono.sh; \
/root/download_gecko_and_mono.sh
USER root
COPY run_mt.sh screenshot.sh /docker/
RUN set -e; \
chmod a+rx /docker/run_mt.sh /docker/screenshot.sh; \
mkdir -p /tmp/screenshots/; \
chown winer:winer /tmp/screenshots/
USER $USER
WORKDIR $MT4DIR
VOLUME /tmp/screenshots/
ENTRYPOINT ["/bin/bash"]
CMD ["/docker/run_mt.sh"]