-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-Alpine
51 lines (42 loc) · 1.54 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
#
# alpine:harmony
#
FROM alpine:latest as base
# Install openjdk, rsync, unzip, wget, fontconfig, curl, and bash
RUN apk --update add openjdk8 rsync unzip wget fontconfig curl bash ruby ruby-dev make gcc libc-dev
# Define environment variables for product, version, etc.
ENV CLEO_INSTALL_FOLDER=/opt/harmony
RUN mkdir $CLEO_INSTALL_FOLDER
#Start json log tailer
COPY tools $CLEO_INSTALL_FOLDER
RUN gem install json
RUN chmod +x /opt/harmony/versalex.rb
# Make a non-root user and group
RUN addgroup cleo \
&& adduser -h /home/cleo -G cleo harmony -D \
&& chown harmony:cleo $CLEO_INSTALL_FOLDER
USER harmony
WORKDIR /opt/harmony
FROM base as installer
# Establish defaults for the options to add as well as the files to modify
ARG LAX_OPTIONS='-Djava.security.egd=file:/dev/./urandom'
ARG LAX_FILES="${CLEO_INSTALL_FOLDER}/*.lax"
COPY --chown=harmony target/install-Harmony-5.7-novm.bin install.bin
RUN chmod +x install.bin \
&& ./install.bin \
-i silent \
-DUSER_INSTALL_DIR="$CLEO_INSTALL_FOLDER" \
&& sed -i -- "s|lax.nl.java.option.additional=|lax.nl.java.option.additional=${LAX_OPTIONS} |g" ${LAX_FILES} \
&& rm ./install.bin
COPY hosts $CLEO_INSTALL_FOLDER/hosts
COPY licenses $CLEO_INSTALL_FOLDER/licenses
COPY syncs $CLEO_INSTALL_FOLDER/syncs
COPY conf $CLEO_INSTALL_FOLDER/conf
COPY docker-entrypoint.sh $CLEO_INSTALL_FOLDER
FROM base
COPY --from=installer --chown=harmony /opt/harmony /opt/harmony
WORKDIR /opt/harmony
ENV INDEX=1
RUN chmod +x /opt/harmony/docker-entrypoint.sh
ENTRYPOINT ["/opt/harmony/docker-entrypoint.sh"]
CMD ["bash"]