-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.cloudstream.ubuntu
155 lines (124 loc) · 3.53 KB
/
Dockerfile.cloudstream.ubuntu
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#####
#
# Used to generate the 'unidata/cloudstream' docker container.
# Visit us on the web at http://www.unidata.ucar.edu
#
# Copyright Unidata 2015 - 2018
#
#####
FROM ubuntu:trusty
MAINTAINER Ward Fisher <wfisher@ucar.edu>
ENV CLOUDSTREAM_VERSION development
# Set the following, required for IDV 5.5+
# ENV MESA_GL_VERSION_OVERRIDE 3.1
#####
# Update base docker image.
#####
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y upgrade
###
# Install bare minimum set of tools.
###
RUN apt-get install -y nano curl x11vnc xvfb xinit git python zip xdg-utils firefox python3-tk python3-pexpect fluxbox x11-apps swisswatch man mesa-utils sudo bzip2 net-tools
###
# Set up a non-root user account.
###
ENV CUSER stream
ENV CUSERPWORD "password.1234"
RUN useradd -ms /bin/bash ${CUSER}
RUN adduser ${CUSER} sudo
# There is no need for the password to be known, so
# randomize it for now.
RUN echo "${CUSER}:${CUSERPWORD}${RANDOM} " | chpasswd
RUN echo "${CUSER} ALL=NOPASSWD: ALL" >> /etc/sudoers
#####
# Switch to the non-root user,
# configure system and environment.
#####
USER ${CUSER}
ENV HOME /home/${CUSER}
WORKDIR ${HOME}
RUN mkdir ~/.vnc
###
# Create a .xinitrc file.
#
# The environmental variable APORT = 5901 by default but can be
# overridden when invoking 'docker run', e.g.
# $ docker run -e APORT=4435
###
RUN echo '/usr/bin/x11vnc -display :1 $SHARESTRING -autoport $APORT -repeat -forever &' > ~/.xinitrc.nopassword
RUN echo '/usr/bin/x11vnc -usepw -display :1 $SHARESTRING -autoport $APORT -repeat -forever &' > ~/.xinitrc.password
RUN echo "/usr/bin/startfluxbox" >> ~/.xinitrc.nopassword
RUN echo "/usr/bin/startfluxbox" >> ~/.xinitrc.password
###
# Configure fluxbox.
###
RUN mkdir ~/.fluxbox/
RUN bash -c 'echo "xterm &" >> ~/.fluxbox/startup'
RUN echo "/usr/bin/fluxbox -log ~/.fluxbox/log" >> ~/.fluxbox/startup
#####
# Set up Websocket-based VNC.
#####
###
# Expose Websocket port for VNC server.
###
ENV APORT 5901
ENV WPORT 6080
EXPOSE ${WPORT}
RUN git clone git://github.com/kanaka/noVNC
RUN cp /home/${CUSER}/noVNC/vnc.html /home/${CUSER}/noVNC/index.html
##
# Added an ssl-only option to a fork of noVNC,
# use the forked version until it is merged into official repo.
##
RUN cd /home/${CUSER}/noVNC/utils && git clone https://github.com/kanaka/websockify
###
# Install rclone from prebuilt binary.
###
USER root
RUN curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip && unzip -j -d /usr/bin rclone-current-linux-amd64.zip
USER ${CUSER}
###
# We can parameterize screen dimensions
# with the following variables.
# e.g.
# docker run -p 6080:6080 -e SIZEH=800 -e SIZEW=640 -e CDEPTH=8 \
# -it [docker image] bootstrap.sh
###
ENV SIZEW 1680
ENV SIZEH 1050
ENV CDEPTH 24
###
# Set up an option to allow for sharing.
###
ENV SHARESTRING --noshared
###
# Copy over a few files.
###
COPY start.sh ${HOME}/
COPY bootstrap.sh ${HOME}/
COPY Dockerfile.cloudstream.ubuntu ${HOME}/
COPY Dockerfile.template ${HOME}/
COPY README.md ${HOME}/
COPY COPYRIGHT_CLOUDSTREAM.md ${HOME}/
COPY RELEASE_NOTES.md ${HOME}/
COPY QUICKSTART.md ${HOME}/
RUN mv README.md CLOUDSTREAM_README.md
ADD examples ${HOME}/examples
###
# Create a version file.
###
ENV VERSION_FILE VERSION.md
RUN echo "CloudStream Version: "$CLOUDSTREAM_VERSION" $(date)" > $VERSION_FILE
###
# A little housekeeping.
###
USER root
RUN chown -R ${CUSER}:${CUSER} ${HOME}
USER ${CUSER}
###
# Run the bootstrap.sh script.
# This will set up/run the VNC environment,
# and execute the start.sh file if present.
###
CMD /home/${CUSER}/bootstrap.sh