From 74d7107425553cbebe2b2ea6ef26507bfa583708 Mon Sep 17 00:00:00 2001 From: v Date: Sun, 27 Oct 2024 18:41:34 +0100 Subject: [PATCH] arm64,amd64 --- .github/workflows/containers.yml | 17 ++--------------- containers/tezos/Dockerfile | 10 +++++++++- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 1ff35b59ac..3325699f77 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -23,26 +23,13 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: tezwatch container + - name: tezos container uses: docker/build-push-action@v4 with: file: ./containers/tezos/Dockerfile - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 build-args: | GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} - ARCH=x64 - tags: ghcr.io/tez-capital/tezos:latest - push: true - provenance: false - - - name: tezwatch container - uses: docker/build-push-action@v4 - with: - file: ./containers/tezos/Dockerfile - platforms: linux/arm64 - build-args: | - GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} - ARCH=arm64 tags: ghcr.io/tez-capital/tezos:latest push: true provenance: false \ No newline at end of file diff --git a/containers/tezos/Dockerfile b/containers/tezos/Dockerfile index efad40bf1c..27091cc71b 100644 --- a/containers/tezos/Dockerfile +++ b/containers/tezos/Dockerfile @@ -1,5 +1,6 @@ FROM docker.io/ubuntu:jammy +ARG TARGETPLATFORM ARG ARCH ENV TEZOS_USER=tezos \ @@ -18,7 +19,14 @@ RUN useradd -m -d ${TEZOS_HOME} -s /bin/bash ${TEZOS_USER} COPY scripts/docker/entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/entrypoint.sh -RUN LATEST_TAG=$(curl -s ${REPO_API} | jq -r .tag_name) && \ +RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ + ARCH="x64"; \ + elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ + ARCH="arm64"; \ + else \ + echo "Unsupported platform: ${TARGETPLATFORM}"; exit 1; \ + fi && \ + LATEST_TAG=$(curl -s ${REPO_API} | jq -r .tag_name) && \ DOWNLOAD_URL="https://github.com/tez-capital/tezos/releases/download/${LATEST_TAG}/octez-all-${ARCH}.zip" && \ echo "Downloading ${DOWNLOAD_URL}" && \ curl -L -o octez.zip ${DOWNLOAD_URL} && \