-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
92 lines (74 loc) · 2.62 KB
/
Dockerfile
File metadata and controls
92 lines (74 loc) · 2.62 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
# syntax=docker/dockerfile:1.20.0@sha256:26147acbda4f14c5add9946e2fd2ed543fc402884fd75146bd342a7f6271dc1d
# check=error=true
# Manifest list digest because of multi architecture builds ( https://www.redhat.com/architect/pull-container-image#:~:text=A%20manifest%20list%20exists%20to,system%20on%20a%20specific%20architecture )
# https://hub.docker.com/_/python/tags
# In Docker Hub, open up the tag and look for Index Digest. Otherwise do:
# docker pull python:3.12-slim-bullseye and see the digest that appears in the output.
FROM python:3.12-slim-bullseye@sha256:411fa4dcfdce7e7a3057c45662beba9dcd4fa36b2e50a2bfcd6c9333e59bf0db
ARG PRODUCT_VERSION
ARG RELEASE_VERSION
ARG KEYCLOAK_VERSION
ARG STACKABLE_USER_UID
ARG STACKABLE_USER_GID
ARG STACKABLE_USER_NAME
LABEL name="Stackable Testing Tools" \
maintainer="[email protected]" \
vendor="Stackable GmbH" \
version="${PRODUCT_VERSION}" \
release="${RELEASE_VERSION}" \
summary="Stackable tools for integration tests." \
description="Used by Stackable integration tests."
# https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
# This is needed so that krb5-user installs without prompting for a realm.
ENV DEBIAN_FRONTEND=noninteractive
COPY testing-tools/python /stackable/python
COPY testing-tools/licenses /licenses
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
gzip \
jq \
`# krb5-user/libkrb5-dev are needed for Kerberos support. ` \
krb5-user \
libkrb5-dev \
kubernetes-client \
libssl-dev \
libxml2-dev \
libxslt1-dev \
pkg-config \
python3-certifi \
python3-idna \
python3-semver \
python3-thrift \
python3-toml \
python3-urllib3 \
tar \
zip \
unzip \
`# Java 11 seems like the best middle-ground for all tools` \
openjdk-11-jdk-headless
apt-get clean
rm -rf /var/lib/apt/lists/*
curl --fail -L https://repo.stackable.tech/repository/packages/keycloak/keycloak-${KEYCLOAK_VERSION}.tar.gz | tar -xzC /stackable
ln -s /stackable/keycloak-${KEYCLOAK_VERSION} /stackable/keycloak
pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir -r /stackable/python/requirements.txt
groupadd --gid ${STACKABLE_USER_GID} --system ${STACKABLE_USER_NAME}
useradd \
--no-log-init \
--gid ${STACKABLE_USER_GID} \
--uid ${STACKABLE_USER_UID} \
--system \
--create-home \
--home-dir /stackable \
${STACKABLE_USER_NAME}
chown -R ${STACKABLE_USER_UID}:0 /stackable
EOF
ENV PATH=/stackable/keycloak/bin:$PATH
USER ${STACKABLE_USER_UID}
ENV STACKABLE_PRODUCT_VERSION=${PRODUCT_VERSION}
WORKDIR /stackable