From 628f6b8b7cdc4c73d89d3aec678366f021761cb4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 15 Mar 2023 20:41:08 +0100 Subject: [PATCH] Fix crane docker permissions --- .github/workflows/ci.yml | 7 ------- build_helpers/publish_docker_arm64.sh | 7 +++++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f09e5feac..663cfb1be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -493,13 +493,6 @@ jobs: run: | echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin - # - name: GHCR.io login - # env: - # GHCR_USERNAME: ${{ github.actor }} - # GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - # run: | - # echo "${GHCR_PASSWORD}" | docker login ghcr.io --username ${GHCR_USERNAME} --password-stdin - - name: Build and test and push docker images env: BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }} diff --git a/build_helpers/publish_docker_arm64.sh b/build_helpers/publish_docker_arm64.sh index 3de113d37..ce0fab6ec 100755 --- a/build_helpers/publish_docker_arm64.sh +++ b/build_helpers/publish_docker_arm64.sh @@ -86,9 +86,11 @@ docker manifest push -p ${IMAGE_NAME}:${TAG_FREQAI_RL} # copy images to ghcr.io -alias crane="docker run --rm -v $(pwd)/crane:/home/nonroot/.docker/ gcr.io/go-containerregistry/crane" +alias crane="docker run --rm --i -v $(pwd)/.crane:/home/nonroot/.docker/ gcr.io/go-containerregistry/crane" +mkdir .crane +chmod a+rwx .crane -echo "${GHCR_TOKEN}" | crane auth login ghcr.io -u ${GHCR_USER} --password-stdin +echo "${GHCR_TOKEN}" | crane auth login ghcr.io -u "${GHCR_USERNAME}" --password-stdin crane copy ${IMAGE_NAME}:${TAG} ${GHCR_IMAGE_NAME}:${TAG} crane copy ${IMAGE_NAME}:${TAG_PLOT} ${GHCR_IMAGE_NAME}:${TAG_PLOT} @@ -105,6 +107,7 @@ if [ "${TAG}" = "develop" ]; then fi docker images +rm -rf .crane # Cleanup old images from arm64 node. docker image prune -a --force --filter "until=24h"