-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile-cs
75 lines (59 loc) · 2.21 KB
/
Dockerfile-cs
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
ARG MP_CS_DIR=/opt/connid-connector-server
ARG maintainer=evolveum
ARG imagename=midpoint-connector-server
ARG CS_version=1.5.0.18
ARG CSV_version=2.4
ARG java_version=17
### values for Ubuntu based image ###
# ARG base_image=ubuntu
# ARG base_image_tag=20.04
# ARG java_home=/usr/lib/jvm/java-17-openjdk-amd64
####################################
### values for Alpine based image ###
ARG base_image=alpine
ARG base_image_tag=latest
ARG java_home=/usr/lib/jvm/default-jvm
#####################################
FROM ${base_image}:${base_image_tag}
ARG base_image
ARG MP_CS_DIR
ARG CS_version
ARG CSV_version
RUN if [ "${base_image}" = "alpine" ]; \
then apk --update add --no-cache libxml2-utils curl bash unzip ; \
else apt-get update -y && apt-get install -y curl libxml2-utils ; \
fi
RUN cd /opt && \
curl -O https://nexus.evolveum.com/nexus/repository/releases/net/tirasa/connid/connector-server-zip/${CS_version}/connector-server-zip-${CS_version}.zip && \
unzip connector-server-zip-${CS_version}.zip && \
cd ${MP_CS_DIR}/bundles/ && \
curl -O https://nexus.evolveum.com/nexus/repository/releases/com/evolveum/polygon/connector-csv/${CSV_version}/connector-csv-${CSV_version}.jar
COPY ./container_files/connectorserver-container ${MP_CS_DIR}/bin/
FROM ${base_image}:${base_image_tag}
ARG MP_CS_DIR
ARG base_image
ARG maintainer
ARG imagename
ARG java_home
ARG java_version
LABEL Vendor="${maintainer}"
LABEL ImageType="base"
LABEL ImageName="${imagename}"
LABEL ImageOS="${base_image}:${base_image_tag}"
LABEL AppBuildID="${MP_CS_DIST_INFO}"
LABEL org.opencontainers.image.authors="[email protected]"
ENV JAVA_HOME=${java_home} \
TZ=UTC \
MP_CS_DIR=${MP_CS_DIR}
RUN if [ "${base_image}" = "alpine" ]; \
then apk --update add --no-cache openjdk${java_version}-jre-headless curl libxml2-utils tzdata bash ; \
else sed 's/main$/main universe/' -i /etc/apt/sources.list && \
apt-get update -y && \
apt-get install -y openjdk-${java_version}-jre-headless tzdata curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ; \
fi
COPY --from=0 ${MP_CS_DIR} ${MP_CS_DIR}/
EXPOSE 8759
CMD [ "/opt/connid-connector-server/bin/connectorserver-container" ]
VOLUME ${MP_CS_DIR}/bundles