-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
79 lines (68 loc) · 2.96 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
# GRADLE BUILD CONTAINER for OSGi Java implementation
# build OSGi app with gradle and bndtools
FROM gradle:6.9.0-jdk11 AS java-build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN ls -l /home/gradle/src/
# calling gradle explicitly for all platform-independent and linux.gtk projects
RUN gradle --no-daemon clean \
export.app.ui_linux.gtk.x86-64 \
export.12_equinoxapp_linux.gtk.x86-64 \
export.ui_linux.gtk.x86-64
# GOLANG BUILD CONTAINER for easy-novnc
# build easy-novnc server
FROM golang:1.14-buster AS easy-novnc-build
WORKDIR /src
RUN go mod init build && \
go get github.com/geek1011/easy-novnc@v1.1.0 && \
go build -o /bin/easy-novnc github.com/geek1011/easy-novnc
# APPLICATION RUNTIME container
FROM debian:buster
ARG BUILD_DATE
ARG VCS_REF
LABEL org.opencontainers.image.authors="dev@klib.io" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/klibio/example.bnd.rcp" \
org.label-schema.vcs-ref=$VCS_REF
# Workaround https://unix.stackexchange.com/questions/2544/how-to-work-around-release-file-expired-problem-on-a-local-mirror
RUN echo "Acquire::Check-Valid-Until \"false\";\nAcquire::Check-Date \"false\";" | cat > /etc/apt/apt.conf.d/10no--check-valid-until
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
openbox \
tigervnc-standalone-server \
supervisor \
gosu \
\
libxext6 \
libxtst6 \
\
pcmanfm \
xarchiver \
nano \
geany \
procps && \
rm -rf /var/lib/apt/lists && \
mkdir -p /usr/share/desktop-directories
RUN apt-get update -y && \
apt-get install -y --no-install-recommends lxterminal wget openssh-client rsync ca-certificates xdg-utils htop tar xzip gzip bzip2 zip unzip && \
rm -rf /var/lib/apt/lists
COPY --from=easy-novnc-build /bin/easy-novnc /usr/local/bin/
COPY menu.xml /etc/xdg/openbox/
COPY supervisord.conf /etc/
COPY pop/pop.sh /data/pop.sh
EXPOSE 8080
#add unix user and group with specific home dir
RUN groupadd --gid 1000 app && \
useradd --home-dir /data --shell /bin/bash --uid 1000 --gid 1000 app && \
mkdir -p /data
VOLUME /data
ARG JavaURL=https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.11%2B9/OpenJDK11U-jre_x64_linux_hotspot_11.0.11_9.tar.gz
SHELL [ "/bin/bash", "-c"]
RUN cd /data && \
wget -q -O - ${JavaURL} | tar -xvz && \
JavaURLdecoded=$(echo "$JavaURL" | sed "s/%2B/+/") \
extractJavaDir=`expr "${JavaURLdecoded}" : '.*/\(.*\)/.*'`-jre && mv ${extractJavaDir} jre
COPY --from=java-build /home/gradle/src/example.rcp.app.ui/generated/distributions/executable /data
COPY --from=java-build /home/gradle/src/example.rcp.ui/generated/distributions/executable/*.jar /data
COPY --from=java-build /home/gradle/src/example.osgi.services/generated/distributions/executable/*.jar /data
CMD ["sh", "-c", "chown app:app /data /dev/stdout && exec gosu app supervisord"]