generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (37 loc) · 1.3 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
46
47
48
# checkov:skip=CKV_DOCKER_2:Healthcheck instructions have not been added to container images
# This image is an example base image for this template and can be replaced to fit user needs
FROM public.ecr.aws/ubuntu/ubuntu@sha256:5b2fc4131b3c134a019c3ea815811de70e6ad9ee1626f59bf302558a95b436e5
LABEL org.opencontainers.image.vendor="Ministry of Justice" \
org.opencontainers.image.authors="Analytical Platform ([email protected])"\
org.opencontainers.image.title="{image title}" \
org.opencontainers.image.description="{decription}" \
org.opencontainers.image.url="{your repo url}"
ENV CONTAINER_USER="analyticalplatform" \
CONTAINER_UID="1001" \
CONTAINER_GROUP="analyticalplatform" \
CONTAINER_GID="1001" \
DEBIAN_FRONTEND="noninteractive"
SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]
# User
RUN <<EOF
groupadd \
--gid ${CONTAINER_GID} \
${CONTAINER_GROUP}
useradd \
--uid ${CONTAINER_UID} \
--gid ${CONTAINER_GROUP} \
--create-home \
--shell /bin/bash \
${CONTAINER_USER}
EOF
# Base
RUN <<EOF
apt-get update --yes
apt-get install --yes \
"apt-transport-https=2.7.14build2" \
"curl=8.5.0-2ubuntu10.5"
apt-get clean --yes
rm --force --recursive /var/lib/apt/lists/*
EOF
USER ${CONTAINER_USER}
WORKDIR /home/${CONTAINER_USER}