-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-concourse
58 lines (44 loc) · 1.67 KB
/
Dockerfile-concourse
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
FROM ubuntu:24.04 AS builder
RUN set -eux; \
apt-get update; \
apt-get -y upgrade; \
apt-get install --yes --no-install-recommends \
ca-certificates \
wget \
jq
ARG JAVA_VERSION="21"
RUN ARCH="x86"; BUNDLE="jdk"; \
wget "https://api.azul.com/zulu/download/community/v1.0/bundles/latest/?java_version=$JAVA_VERSION&ext=tar.gz&os=linux&arch=$ARCH&hw_bitness=64&release_status=ga&bundle_type=$BUNDLE" -O jdk-info.json
RUN wget --progress=bar:force:noscroll -O "jdk.tar.gz" $(cat jdk-info.json | jq --raw-output .url)
RUN echo "$(cat jdk-info.json | jq --raw-output .sha256_hash) *jdk.tar.gz" | sha256sum --check --strict -
RUN set -eux; \
JAVA_PATH="/usr/lib/jdk-$JAVA_VERSION"; \
mkdir $JAVA_PATH && \
tar --extract --file jdk.tar.gz --directory "$JAVA_PATH" --strip-components 1; \
$JAVA_PATH/bin/jlink --compress=zip-6 --output /jre --add-modules java.base,jdk.crypto.cryptoki,java.net.http; \
/jre/bin/java -version \
; \
mkdir -p /app
COPY target/cloudsmith-ci-connector.jar /app
FROM ubuntu:24.04
RUN set -eux; \
\
apt-get update; \
apt-get -y upgrade; \
apt-get install --yes --no-install-recommends \
ca-certificates \
; \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk/jre
RUN mkdir -p $JAVA_HOME
COPY --from=builder /jre $JAVA_HOME/
RUN ln -svT $JAVA_HOME/bin/java /usr/local/bin/java
COPY --from=builder /app/* /opt/resource/
RUN set -eux; \
java -jar /opt/resource/cloudsmith-ci-connector.jar test
RUN groupadd --gid 1042 cloudsmith
RUN useradd --uid 1042 --gid cloudsmith --comment "cloudsmith user" cloudsmith
USER cloudsmith:cloudsmith
COPY scripts/* /opt/resource/