generated from ministryofjustice/analytical-platform-image-build-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (32 loc) · 1.31 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
# checkov:skip=CKV_DOCKER_2:Healthcheck instructions have not been added to container images
FROM docker.io/alpine:3.20.3
LABEL org.opencontainers.image.vendor="Ministry of Justice" \
org.opencontainers.image.authors="Analytical Platform" \
org.opencontainers.image.title="kubectl Image" \
org.opencontainers.image.description="kubectl image for Analytical Platform" \
org.opencontainers.image.url="https://github.com/ministryofjustice/analytical-platform-kubectl"
ARG KUBECTL_VERSION="v1.29.6"
ENV CONTAINER_GID="10000" \
CONTAINER_GROUP="nonroot" \
CONTAINER_UID="10000" \
CONTAINER_USER="nonroot" \
CONTAINER_HOME="/app"
RUN addgroup \
--gid ${CONTAINER_GID} \
--system \
${CONTAINER_GROUP} \
&& adduser \
--uid ${CONTAINER_UID} \
--ingroup ${CONTAINER_GROUP} \
--disabled-password \
${CONTAINER_USER} \
&& mkdir --parents ${CONTAINER_HOME} \
&& chown --recursive ${CONTAINER_USER}:${CONTAINER_GROUP} ${CONTAINER_HOME} \
&& apk add --no-cache --virtual build \
curl==8.11.0-r2 \
&& curl --location "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \
--output /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& apk del build
USER ${CONTAINER_USER}
WORKDIR ${CONTAINER_HOME}