From 6f751db5b61386339f20de1f3f7be6f526c02988 Mon Sep 17 00:00:00 2001 From: James Harton Date: Wed, 20 Mar 2024 11:38:34 +1300 Subject: [PATCH] chore: explicitly supply arch to subcontainers. --- .drone.yml | 56 +++++++++++++++++++++++++++++------------------ elixir/Dockerfile | 4 +++- rust/Dockerfile | 4 +++- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7ee430a..b9aea09 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,6 +7,10 @@ platform: os: linux arch: arm64 +trigger: + branch: + - main + steps: - name: dev-container/base image: plugins/docker @@ -16,12 +20,13 @@ steps: from_secret: REGISTRY_TOKEN registry: harton.dev repo: harton.dev/james/dev-container/base + cache_from: harton.dev/james/dev-container/base:latest-arm64 context: ./base dockerfile: ./base/Dockerfile platform: linux/arm64 pull: true - auto_tag: true - auto_tag_suffix: arm64 + tags: + - latest-arm64 - name: dev-container/elixir image: plugins/docker @@ -36,8 +41,10 @@ steps: context: ./elixir dockerfile: ./elixir/Dockerfile platform: linux/arm64 - auto_tag: true - auto_tag_suffix: arm64 + pull: true + build_args: "ARCH=arm64" + tags: + - latest-arm64 - name: dev-container/rust @@ -53,8 +60,10 @@ steps: context: ./rust dockerfile: ./rust/Dockerfile platform: linux/arm64 - auto_tag: true - auto_tag_suffix: arm64 + pull: true + build_args: "ARCH=arm64" + tags: + - latest-arm64 --- @@ -66,6 +75,10 @@ platform: os: linux arch: amd64 +trigger: + branch: + - main + steps: - name: dev-container/base image: plugins/docker @@ -75,12 +88,13 @@ steps: from_secret: REGISTRY_TOKEN registry: harton.dev repo: harton.dev/james/dev-container/base + cache_from: harton.dev/james/dev-container/base:latest-amd64 context: ./base dockerfile: ./base/Dockerfile platform: linux/amd64 pull: true - auto_tag: true - auto_tag_suffix: amd64 + tags: + - latest-amd64 - name: dev-container/elixir image: plugins/docker @@ -95,8 +109,11 @@ steps: context: ./elixir dockerfile: ./elixir/Dockerfile platform: linux/amd64 - auto_tag: true - auto_tag_suffix: amd64 + pull: true + build_args: "ARCH=amd64" + tags: + - latest-amd64 + - name: dev-container/rust image: plugins/docker @@ -111,8 +128,10 @@ steps: context: ./rust dockerfile: ./rust/Dockerfile platform: linux/amd64 - auto_tag: true - auto_tag_suffix: amd64 + pull: true + build_args: "ARCH=amd64" + tags: + - latest-amd64 --- @@ -124,6 +143,10 @@ depends_on: - build-arm64 - build-amd64 +trigger: + branch: + - main + steps: - name: manifest harton.dev/james/dev-container/base image: plugins/manifest @@ -137,9 +160,6 @@ steps: platforms: - linux/arm64 - linux/amd64 - when: - branch: - - main - name: manifest harton.dev/james/dev-container/elixir image: plugins/manifest @@ -153,9 +173,6 @@ steps: platforms: - linux/arm64 - linux/amd64 - when: - branch: - - main - name: manifest harton.dev/james/dev-container/rust image: plugins/manifest @@ -169,7 +186,4 @@ steps: platforms: - linux/arm64 - linux/amd64 - when: - branch: - - main diff --git a/elixir/Dockerfile b/elixir/Dockerfile index a2a89d7..d982439 100644 --- a/elixir/Dockerfile +++ b/elixir/Dockerfile @@ -1,4 +1,6 @@ -FROM harton.dev/james/dev-container/base +ARG ARCH + +FROM harton.dev/james/dev-container/base:latest-${ARCH} ARG USERNAME=vscode ARG USER_UID=1000 diff --git a/rust/Dockerfile b/rust/Dockerfile index 3737e06..a0168ff 100644 --- a/rust/Dockerfile +++ b/rust/Dockerfile @@ -1,4 +1,6 @@ -FROM harton.dev/james/dev-container/base +ARG ARCH + +FROM harton.dev/james/dev-container/base:latest-${ARCH} RUN asdf asdf plugin add rust RUN asdf asdf install rust latest