Skip to content

Commit 3ec4392

Browse files
committed
build lots of images
1 parent 844be08 commit 3ec4392

21 files changed

Lines changed: 632 additions & 42 deletions

File tree

.github/workflows/build_all_images.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,16 @@ jobs:
3131
tag_latest: ${{ inputs.tag_latest }}
3232
docker_tag: ${{ inputs.docker_tag }}
3333
container_name: ${{ matrix.container_name }}
34+
package_product_docker_image:
35+
needs:
36+
- package_non_base_docker_image
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
include:
41+
- container_name: cpt_api
42+
uses: ./.github/workflows/build_multi_arch_image.yml
43+
with:
44+
tag_latest: ${{ inputs.tag_latest }}
45+
docker_tag: ${{ inputs.docker_tag }}
46+
container_name: ${{ matrix.container_name }}

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ scan-image: guard-CONTAINER_NAME
3737
--exit-code 1 \
3838
--format table "${CONTAINER_PREFIX}$${CONTAINER_NAME}"
3939

40+
shell-image: guard-CONTAINER_NAME
41+
docker run -it \
42+
"${CONTAINER_PREFIX}$${CONTAINER_NAME}" \
43+
bash
44+
4045
lint: lint-githubactions
4146

4247
test:

src/base/.devcontainer/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
22

33
ARG TARGETARCH
44
ENV TARGETARCH=${TARGETARCH}
5-
ARG SCRIPTS_DIR=/usr/local/share/eps/
5+
ARG SCRIPTS_DIR=/usr/local/share/eps
66
ARG CONTAINER_NAME
77
ENV CONTAINER_NAME=${CONTAINER_NAME}
88
ENV SCRIPTS_DIR=${SCRIPTS_DIR}
99

1010
ARG ASDF_VERSION
11-
COPY .tool-versions.asdf /tmp/.tool-versions.asdf
11+
COPY .tool-versions.asdf ${SCRIPTS_DIR}/${CONTAINER_NAME}/.tool-versions.asdf
1212

1313
COPY --chmod=755 scripts ${SCRIPTS_DIR}/${CONTAINER_NAME}
1414
WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME}
@@ -18,8 +18,8 @@ USER vscode
1818

1919
ENV PATH="/home/vscode/.asdf/shims/:$PATH"
2020
WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME}
21-
COPY .tool-versions.asdf /home/vscode/.tool-versions.asdf
22-
COPY .tool-versions /home/vscode/.tool-versions
21+
COPY --chown=vscode:vscode .tool-versions.asdf /home/vscode/.tool-versions.asdf
22+
COPY --chown=vscode:vscode .tool-versions /home/vscode/.tool-versions
2323

2424
RUN ./vscode_install.sh
2525
WORKDIR /home/vscode

src/base/.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
66
"build": {
77
"dockerfile": "Dockerfile",
8-
"args": {}
8+
"args": {
9+
"CONTAINER_NAME": "eps_devcontainer_base"
10+
}
911
},
1012
"runArgs": [
1113
"--network=host"

src/base/.devcontainer/scripts/root_install.sh

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,6 @@ apt-get -y install --no-install-recommends htop vim curl git build-essential \
3030
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
3131
xz-utils tk-dev liblzma-dev netcat-traditional libyaml-dev uuid-runtime xxd unzip
3232

33-
# install aws stuff
34-
# Download correct AWS CLI for arch
35-
# echo "Installing aws cli"
36-
# if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then
37-
# wget -O /tmp/awscliv2.zip --no-verbose "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"
38-
# else
39-
# wget -O /tmp/awscliv2.zip --no-verbose "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"
40-
# fi
41-
# unzip -q /tmp/awscliv2.zip -d /tmp/aws-cli
42-
# /tmp/aws-cli/aws/install
43-
# rm /tmp/awscliv2.zip
44-
# rm -rf /tmp/aws-cli
45-
4633
# Download correct SAM CLI for arch
4734
echo "Installing aws-sam cli"
4835
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then
@@ -57,7 +44,7 @@ if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then
5744

5845
# Install ASDF
5946
echo "Installing asdf"
60-
ASDF_VERSION=$(awk '!/^#/ && NF {print $1; exit}' /tmp/.tool-versions.asdf)
47+
ASDF_VERSION=$(awk '!/^#/ && NF {print $1; exit}' "${SCRIPTS_DIR}/${CONTAINER_NAME}/.tool-versions.asdf")
6148
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then
6249
wget -O /tmp/asdf.tar.gz --no-verbose "https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-arm64.tar.gz"
6350
else

src/common/Dockerfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ ARG BASE_VERSION=latest
22

33
FROM ghcr.io/nhsdigital/eps-devcontainers/base:${BASE_VERSION}
44

5-
# common Dockerfile used to setup poetry after installing python
5+
ARG CONTAINER_NAME
6+
ENV CONTAINER_NAME=${CONTAINER_NAME}
67

7-
ARG POETRY_VERSION=2.3.2
8+
USER root
9+
COPY --chmod=755 scripts ${SCRIPTS_DIR}/${CONTAINER_NAME}
10+
WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME}
11+
RUN ./root_install.sh
812

9-
RUN curl -sSL https://install.python-poetry.org | python3 - --version ${POETRY_VERSION}
13+
USER vscode
1014

11-
ENV PATH="/home/vscode/.local/bin:${PATH}"
15+
WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME}
16+
COPY .tool-versions /tmp/.tool-versions
17+
RUN cat /tmp/.tool-versions >> /home/vscode/.tool-versions
18+
19+
RUN ./vscode_install.sh
20+
WORKDIR /home/vscode

src/cpt_api/.devcontainer/.tool-versions

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ARG BASE_VERSION=latest
2+
3+
FROM ghcr.io/nhsdigital/eps-devcontainers/base:${BASE_VERSION}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3+
{
4+
"name": "EPS Devcontainer node_24 python_3.13",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"build": {
7+
"dockerfile": "Dockerfile",
8+
"args": {
9+
"BASE_VERSION": "${localEnv:BASE_VERSION}",
10+
"CONTAINER_NAME": "cpt_api"
11+
},
12+
"context": "."
13+
},
14+
"runArgs": [
15+
"--network=host"
16+
],
17+
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
18+
"features": {}
19+
}
20+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
set -e

0 commit comments

Comments
 (0)