Skip to content

Commit

Permalink
Explicitly define target platform for building images (idaholab#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed May 7, 2024
1 parent ca58ed2 commit 6b359c7
Show file tree
Hide file tree
Showing 41 changed files with 108 additions and 47 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/api-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/api.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/arkime-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/arkime.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dashboards-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/dashboards.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dashboards-helper-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/dashboards-helper.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dirinit-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -83,6 +83,7 @@ jobs:
context: .
file: ./Dockerfiles/dirinit.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/file-monitor-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -93,6 +93,7 @@ jobs:
context: .
file: ./Dockerfiles/file-monitor.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/file-upload-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/file-upload.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/filebeat-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/filebeat.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/freq-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/freq.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/htadmin-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/htadmin.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/logstash-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/logstash.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/netbox-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/netbox.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nginx-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -101,6 +101,7 @@ jobs:
context: .
file: ./Dockerfiles/nginx.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/opensearch-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
context: .
file: ./Dockerfiles/opensearch.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pcap-capture-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/pcap-capture.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pcap-monitor-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
context: .
file: ./Dockerfiles/pcap-monitor.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/postgresql-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
context: .
file: ./Dockerfiles/postgresql.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/redis-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
context: .
file: ./Dockerfiles/redis.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/suricata-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
context: .
file: ./Dockerfiles/suricata.Dockerfile
build-args: |
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/zeek-build-and-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
platform:
- linux/amd64
# - linux/arm64
- linux/arm64
steps:
-
name: Cancel previous run in progress
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
file: ./Dockerfiles/zeek.Dockerfile
build-args: |
BUILD_JOBS=2
TARGETPLATFORM=${{ matrix.platform }}
MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }}
BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }}
VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }}
Expand Down
6 changes: 4 additions & 2 deletions Dockerfiles/api.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM python:3-slim-bookworm as builder
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} python:3-slim-bookworm as builder

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand All @@ -18,7 +20,7 @@ WORKDIR /usr/src/app
RUN python3 -m pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt \
&& flake8 --ignore=E203,E501,F401,W503

FROM python:3-slim-bookworm
FROM --platform=${TARGETPLATFORM} python:3-slim-bookworm

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="[email protected]"
Expand Down
6 changes: 4 additions & 2 deletions Dockerfiles/arkime.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM debian:12-slim AS build
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim AS build

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.

Expand Down Expand Up @@ -79,7 +81,7 @@ RUN export DEBARCH=$(dpkg --print-architecture) && \
curl -fsSL -o "${ARKIME_DIR}/plugins/ja4plus.${DEBARCH}.so" "https://github.com/arkime/arkime/releases/download/${ARKIME_VERSION}/ja4plus.${DEBARCH}.so" && \
chmod 755 "${ARKIME_DIR}/plugins/ja4plus.${DEBARCH}.so"

FROM debian:12-slim
FROM --platform=${TARGETPLATFORM} debian:12-slim

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.authors='[email protected]'
Expand Down
4 changes: 3 additions & 1 deletion Dockerfiles/dashboards-helper.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM alpine:3.19
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} alpine:3.19

# Copyright (c) 2020 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="[email protected]"
Expand Down
4 changes: 3 additions & 1 deletion Dockerfiles/dashboards.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM opensearchproject/opensearch-dashboards:2.13.0
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} opensearchproject/opensearch-dashboards:2.13.0

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.authors='[email protected]'
Expand Down
4 changes: 3 additions & 1 deletion Dockerfiles/dirinit.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM alpine:3.19
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} alpine:3.19

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="[email protected]"
Expand Down
Loading

0 comments on commit 6b359c7

Please sign in to comment.