Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/base-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Update base image
on:
push:
branches:
- main
- trixie
paths:
- image/Dockerfile-base
- .github/workflows/base-image.yaml
Expand Down Expand Up @@ -41,13 +41,13 @@ jobs:
- name: Base image
id: build-and-push
run: |
BASE_DIGEST=$(docker buildx imagetools inspect "debian:bookworm-slim" --format '{{json .}}' | jq -r '.manifest.digest')
BASE_DIGEST=$(docker buildx imagetools inspect "debian:trixie-slim" --format '{{json .}}' | jq -r '.manifest.digest')

sed -i "s|FROM debian:bookworm-slim|FROM debian:bookworm-slim@$BASE_DIGEST|" "image/Dockerfile-base"
sed -i "s|FROM debian:trixie-slim|FROM debian:trixie-slim@$BASE_DIGEST|" "image/Dockerfile-base"

docker buildx build \
--tag "danielflook/terraform-github-actions-base:$GITHUB_RUN_ID" \
--tag danielflook/terraform-github-actions-base:latest \
--tag danielflook/terraform-github-actions-base:trixie \
--platform linux/amd64,linux/arm64 \
--attest "type=provenance,mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
--annotation "index,manifest:org.opencontainers.image.created=$(date '+%Y-%m-%dT%H:%M:%S%z')" \
Expand All @@ -58,7 +58,7 @@ jobs:
--annotation "index:org.opencontainers.image.ref.name=docker.io/danielflook/terraform-github-actions-base:$GITHUB_RUN_ID" \
--annotation "index,manifest:builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
--annotation "index,manifest:ref.tag=$GITHUB_RUN_ID" \
--annotation "index,manifest:org.opencontainers.image.base.name=docker.io/debian:bookworm-slim" \
--annotation "index,manifest:org.opencontainers.image.base.name=docker.io/debian:trixie-slim" \
--annotation "index,manifest:base.manifest.digest=$BASE_DIGEST" \
--file image/Dockerfile-base \
--push \
Expand Down
9 changes: 8 additions & 1 deletion image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# hadolint ignore=DL3007
FROM danielflook/terraform-github-actions-base:latest
FROM danielflook/terraform-github-actions-base:trixie

ARG TARGETARCH

ARG FETCH_CHECKSUMS
ARG VERSION=99.0.0

RUN <<EOF

Check failure on line 9 in image/Dockerfile

View workflow job for this annotation

GitHub Actions / Linting

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get update
apt-get install --no-install-recommends -y \
python3-setuptools
rm -rf /var/lib/apt/lists/*
EOF

COPY src/ /tmp/src/
COPY setup.py /tmp
RUN sed -i "s|version='.*'|version=\'${VERSION}\'|" /tmp/setup.py \
Expand Down
2 changes: 1 addition & 1 deletion image/Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN git clone https://github.com/cloudposse/tfmask.git \
&& make \
&& make go/build

FROM debian:bookworm-slim AS terraform-github-actions-base
FROM debian:trixie-slim AS terraform-github-actions-base

# Terraform environment variables
ENV CHECKPOINT_DISABLE=true
Expand Down
Loading