forked from petalslink/docker-petals-cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (37 loc) · 1.72 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
FROM openjdk:8-jre-alpine
# Expose ports
EXPOSE 8080
# Add tags
LABEL \
maintainer="The Petals team" \
contributors="Pierre Souquet (Linagora), Vincent Zurczak (Linagora)" \
github="https://github.com/petalslink"
# Build arguments & variables
ARG COCKPIT_VERSION="LATEST"
ENV DOWNLOAD_URL="https://gitlab.com/linagora/petals-cockpit/builds/artifacts/"
# Copy the script (first)
COPY docker-wrapper.sh /opt/petals-cockpit/docker-wrapper.sh
# FIXME: unable to get the latest tag of gitlab without specific tag :
# see https://gitlab.com/gitlab-org/gitlab-ce/issues/22273
# and https://gitlab.com/gitlab-org/gitlab-ce/issues/26254
# For now latest tag must be updated each release of cockpit.
# Important: temporary system packages are deleted at the end.
RUN apk update && \
apk add curl bash && \
rm -rf /var/cache/apk/* && \
apk upgrade && \
{ [ "${COCKPIT_VERSION}" = "LATEST" ] && export DOWNLOAD_URL="${DOWNLOAD_URL}v0.26.0/download?job=release-product"; } || \
{ [ "${COCKPIT_VERSION}" = "SNAPSHOT" ] && export DOWNLOAD_URL="${DOWNLOAD_URL}master/download?job=package-product-master"; } || \
{ export DOWNLOAD_URL="${DOWNLOAD_URL}${COCKPIT_VERSION}/download?job=release-product"; } && \
echo "Downloading ${COCKPIT_VERSION}: ${DOWNLOAD_URL}" && \
curl -L "${DOWNLOAD_URL}" -o /tmp/petals-cockpit.zip --silent && \
mkdir /tmp/petals-cockpit-zip && \
unzip /tmp/petals-cockpit.zip -d /tmp/petals-cockpit-zip && \
cp -r /tmp/petals-cockpit-zip/petals-cockpit-*/* /opt/petals-cockpit && \
rm -rf /tmp/petals-cockpit* && \
chmod 775 /opt/petals-cockpit/docker-wrapper.sh && \
apk del curl
# Set the working directory
WORKDIR /opt/petals-cockpit
# Indicate the default script
CMD /opt/petals-cockpit/docker-wrapper.sh