-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.alpine
executable file
·211 lines (162 loc) · 6.01 KB
/
Dockerfile.alpine
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
ARG TARGETPLATFORM
ARG BUILDPLATFORM
# Default release is 18.04
ARG BASE_IMAGE_RELEASE=edge
# Default base image
ARG BASE_IMAGE=alpine
#
# create apk package for openbox
# pkg files will be located in /root/packages/$(uname -m) directory
# patched with openbox.title.patch for abcdesktop
FROM ${BASE_IMAGE}:${BASE_IMAGE_RELEASE} as openbox_alpine_builder
RUN apk add gcc make g++ bash build-base alpine-sdk sudo wget python3
RUN mkdir -p /var/cache/distfiles
RUN mkdir -p /openbox/src
WORKDIR /openbox
RUN wget https://raw.githubusercontent.com/abcdesktopio/openbox/main/openbox-3.6.1.tar.gz
RUN wget https://git.alpinelinux.org/aports/plain/community/openbox/python3.patch
RUN wget https://raw.githubusercontent.com/abcdesktopio/openbox/main/APKBUILD
RUN wget https://raw.githubusercontent.com/abcdesktopio/openbox/main/openbox.title.patch
RUN abuild-keygen -a -n
RUN abuild -F deps
# -a Add 1 to current pkgrel
RUN apkgrel -a APKBUILD
RUN abuild -F
# package are in directory /root/packages/$(uname -m)
# install all nodejs modules
# build nodejs module
# create /composer/node
# use FROM BASE_IMAGE
# define FROM before use ENV command
FROM ${BASE_IMAGE}:${BASE_IMAGE_RELEASE} as alpine_node_modules_builder
COPY TARGET_MODE /TARGET_MODE
# Add alpine repo
# https://dl-cdn.alpinelinux.org/alpine/edge/main
# https://dl-cdn.alpinelinux.org/alpine/edge/community
# https://dl-cdn.alpinelinux.org/alpine/edge/testing
# Add tagged repos as well as the edge repo so that we can selectively install edge packages
#RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
# echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
# echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --no-cache --update \
python3 \
nodejs \
yarn \
make \
gcc \
g++ \
libx11-dev \
libxmu-dev
COPY composer /composer
RUN mkdir -p /composer/node/wait-port && \
cd /composer/node/wait-port && \
yarn add [email protected]
# Use this flag to instruct Yarn to ignore NODE_ENV and take its production-or-not status from this flag instead.
WORKDIR /composer/node/common-libraries
RUN yarn install --production=true
WORKDIR /composer/node/broadcast-service
RUN yarn install --production=true
WORKDIR /composer/node/ocrun
RUN yarn install --production=true
WORKDIR /composer/node/ocdownload
RUN yarn install --production=true
WORKDIR /composer/node/occall
RUN yarn install --production=true
WORKDIR /composer/node/spawner-service
RUN yarn global add node-gyp
RUN yarn install --production=true
WORKDIR /composer/node/xterm.js
RUN if [ $(cat /TARGET_MODE) != hardening ]; then yarn install --production=true; fi
#
# The main oc.user start here
#
FROM ${BASE_IMAGE}:${BASE_IMAGE_RELEASE}
COPY TARGET_MODE /TARGET_MODE
COPY etc /etc
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --no-cache --update \
gcompat \
python3 \
curl \
bash \
supervisor \
tigervnc \
wmctrl \
cups-client \
pulseaudio-utils \
xauth \
websockify \
openssl \
krb5
RUN apk add --no-cache --update \
desktop-file-utils \
xdg-user-dirs \
xhost \
xsetroot \
adwaita-icon-theme \
adwaita-qt \
xclip \
imagemagick \
libadwaita
# add some fonts
RUN apk add --no-cache --update \
terminus-font \
qterminal
# add some fonts These selections will cover most languages and are a good fit for most setups
RUN apk add --no-cache --update \
ttf-inconsolata \
ttf-dejavu \
ttf-font-awesome \
font-noto-extra \
font-noto
COPY --from=openbox_alpine_builder /root/packages /tmp/packages
RUN apk add --allow-untrusted \
/tmp/packages/$(apk add --print-arch)/openbox-libs-3.6.1* \
/tmp/packages/$(apk add --print-arch)/openbox-3.6.1*
RUN apk add --no-cache --update \
obconf-qt \
nodejs \
feh
COPY --from=alpine_node_modules_builder /composer /composer
#
# themes section
# copy themes from abcdesktopio/oc.themes
# COPY themes /usr/share/themes
# COPY --from=abcdesktopio/oc.themes /usr/share/icons /usr/share/icons
# COPY --from=abcdesktopio/oc.themes /usr/share/themes /usr/share/themes
# COPY --from=theme_builder /usr/share/themes /usr/share/themes
ADD Arc_OSXbuttons.tar /usr/share/themes
# version.json must be created by mkversion.sh bash script
COPY composer/version.json /composer/version.json
# LOG AND PID SECTION
RUN mkdir -p /var/log/desktop /var/run/desktop
# change passwd shadow group gshadow
ENV ABCDESKTOP_LOCALACCOUNT_DIR "/var/secrets/abcdesktop/localaccount"
RUN mkdir -p $ABCDESKTOP_LOCALACCOUNT_DIR
RUN for f in passwd shadow group gshadow ; do if [ -f /etc/$f ] ; then cp /etc/$f $ABCDESKTOP_LOCALACCOUNT_DIR ; rm -f /etc/$f; ln -s $ABCDESKTOP_LOCALACCOUNT_DIR/$f /etc/$f; fi; done
# set build date
RUN date > /etc/build.date
# WORKDIR /home/$BUSER
# set default user
# USER $BUSER
RUN apk add --no-cache --update \
sudo \
vim
RUN echo "ALL ALL=(ALL:ALL) ALL" > /etc/sudoers.d/all
# set command
CMD [ "/composer/docker-entrypoint.sh" ]
####################################################
# SERVICE # TCP PORT #
####################################################
# XTERM_TCP_PORT 29781
# BROADCAST_SERVICE_TCP_PORT 29784
# SPAWNER_SERVICE_TCP_PORT 29786
# WS_TCP_BRIDGE_SERVICE_TCP_PORT 6081
# DBUS_SESSION_TCP_PORT 55556
# DBUS_SYSTEM_TCP_PORT 55557
####################################################
## RESERVED TCP PORT 29782 for pulseaudio
## RESERVED TCP PORT 29785 for cupsd
EXPOSE 6081 29781 29784 29786