generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (35 loc) · 2.01 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
49
50
51
52
53
54
55
56
#checkov:skip=CKV_DOCKER_2: HEALTHCHECK not required - This image is supervised by VS Code's Remote Containers extension
#checkov:skip=CKV_DOCKER_3: USER not required - A non-root user is created, and used by VS Code's Remote Containers extension
# hadolint global ignore=DL3008,DL3013
FROM mcr.microsoft.com/devcontainers/base:1.2.0-ubuntu-24.04
LABEL org.opencontainers.image.vendor="Ministry of Justice" \
org.opencontainers.image.authors="Dev Container Community" \
org.opencontainers.image.title="Base Image" \
org.opencontainers.image.description="Extension of Microsoft's image" \
org.opencontainers.image.url="https://github.com/ministryofjustice/.devcontainer/images/base"
SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]
COPY --chown=nobody:nobody --chmod=0755 src/usr/local/bin/devcontainer-utils /usr/local/bin/devcontainer-utils
COPY --chown=nobody:nobody --chmod=0444 src/usr/local/etc/vscode-dev-containers/first-run-notice.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
COPY --chown=vscode:vscode --chmod=0755 src/home/vscode/.zshrc.snippet /home/vscode/.zshrc.snippet
COPY --chown=vscode:vscode --chmod=0755 src/home/vscode/.oh-my-zsh/custom/themes/devcontainers.zsh-theme /home/vscode/.oh-my-zsh/custom/themes/devcontainers.zsh-theme
RUN <<EOF
apt-get update --yes
apt-get upgrade --yes
apt-get install --yes \
python3-pip
apt-get clean --yes
rm --force --recursive /var/lib/apt/lists/*
chsh --shell "$(which zsh)" vscode
cat /home/vscode/.zshrc.snippet >> /home/vscode/.zshrc
rm --force /home/vscode/.zshrc.snippet
install --directory --owner=vscode --group=vscode /home/vscode/.devcontainer
install --directory --owner=vscode --group=vscode /home/vscode/.devcontainer/featurerc.d
install --directory --owner=vscode --group=vscode /home/vscode/.devcontainer/promptrc.d
install --directory --owner=vscode --group=vscode /home/vscode/.dotfiles
EOF
ONBUILD RUN <<EOF
apt-get update --yes
apt-get upgrade --yes
apt-get clean --yes
rm --force --recursive /var/lib/apt/lists/*
EOF