Fix crane docker permissions

This commit is contained in:
Matthias 2023-03-15 20:41:08 +01:00
parent 0d3de07012
commit 628f6b8b7c
2 changed files with 5 additions and 9 deletions

View File

@ -493,13 +493,6 @@ jobs:
run: | run: |
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin 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 - name: Build and test and push docker images
env: env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }} BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}

View File

@ -86,9 +86,11 @@ docker manifest push -p ${IMAGE_NAME}:${TAG_FREQAI_RL}
# copy images to ghcr.io # 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} ${GHCR_IMAGE_NAME}:${TAG}
crane copy ${IMAGE_NAME}:${TAG_PLOT} ${GHCR_IMAGE_NAME}:${TAG_PLOT} crane copy ${IMAGE_NAME}:${TAG_PLOT} ${GHCR_IMAGE_NAME}:${TAG_PLOT}
@ -105,6 +107,7 @@ if [ "${TAG}" = "develop" ]; then
fi fi
docker images docker images
rm -rf .crane
# Cleanup old images from arm64 node. # Cleanup old images from arm64 node.
docker image prune -a --force --filter "until=24h" docker image prune -a --force --filter "until=24h"