-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
48 lines (39 loc) · 1.34 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
FROM ubuntu:18.04
MAINTAINER Ryan Clouser ([email protected])
ENV DEBIAN_FRONTEND noninteractive
ENV USER docker
ENV DISPLAY :0
ENV ARGS ""
ENV PASSWORD "a"
ENV PROFILE ""
ENV VERSION "latest"
USER root
# Create docker user
RUN useradd -ms /bin/bash docker
WORKDIR /home/docker
# Update
RUN apt update && apt upgrade -qy && apt dist-upgrade -qy
RUN apt install wget ca-certificates tightvncserver fluxbox xterm xautomation -qy
RUN apt clean
RUN rm -rf /var/lib/apt/lists/*
# IB Gateway
USER docker
RUN wget -q https://download2.interactivebrokers.com/installers/ibgateway/$VERSION-standalone/ibgateway-$VERSION-standalone-linux-x64.sh
RUN chmod +x ibgateway-$VERSION-standalone-linux-x64.sh && ./ibgateway-$VERSION-standalone-linux-x64.sh -q && rm -f ibgateway-$VERSION-standalone-linux-x64.sh
# Copy profile settings
USER root
COPY jts.ini /home/$USER/Jts/
RUN mkdir /home/$USER/Jts/$PROFILE
COPY ibg.xml /home/$USER/Jts/$PROFILE/
COPY start.sh /home/$USER/
RUN chmod +x /home/$USER/start.sh
RUN chown $USER:$USER /home/$USER/Jts/jts.ini; chown $USER:$USER /home/$USER/start.sh; chown -R $USER:$USER /home/$USER/Jts/$PROFILE
# VNC
USER docker
RUN mkdir -p /home/$USER/.vnc
RUN set -xe && (echo $PASSWORD | vncpasswd -f > /home/$USER/.vnc/passwd)
RUN chmod 0600 /home/$USER/.vnc/passwd
EXPOSE 7496
EXPOSE 7497
EXPOSE 5900
CMD tightvncserver $DISPLAY; ./start.sh