Skip to content

Commit

Permalink
Docker hub authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
heerener committed Oct 3, 2024
1 parent 0b74831 commit 8cdff1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/build_base_container/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ inputs:
description: Extra args to pass to buildah
required: false
default: ''
DOCKERHUB_USER:
description: Username for Dockerhub authentication
required: true
DOCKERHUB_PASSWORD:
description: Password for Dockerhub authentication
required: true
SPACK_DEPLOYMENT_KEY_PUB:
description: Public key for spack deployments
required: true
Expand All @@ -40,6 +46,7 @@ runs:
export REGISTRY_IMAGE_TAG=latest # for now
echo "${{ inputs.SPACK_DEPLOYMENT_KEY_PUB }}" > ${{ inputs.BUILD_PATH }}/key.pub
aws ecr get-login-password --region us-east-1 | buildah login --username AWS --password-stdin ${{ inputs.AWS_ECR_URL }}
buildah login --username ${{ inputs.DOCKERHUB_USER }} --password ${{ inputs.DOCKERHUB_PASSWORD }} docker.io
# This is written like that in case $BUILDAH_EXTRA_ARGS has args that require spaces,
# which is tricky with shell variable expansion. Similar to Kaniko, see also:
# https://github.com/GoogleContainerTools/kaniko/issues/1803
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/spacktainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
--label ch.epfl.bbpgitlab.ci-commit-branch="$GITHUB_REF_NAME" --build-arg
SPACK_BRANCH=develop
# ' --label org.opencontainers.image.created="$CI_JOB_STARTED_AT"'
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
SPACK_DEPLOYMENT_KEY_PUB: ${{ secrets.SPACK_DEPLOYMENT_KEY_PUB }}
- name: create runtime
uses: ./.github/actions/build_base_container
Expand All @@ -43,6 +45,8 @@ jobs:
--label ch.epfl.bbpgitlab.ci-commit-branch="$GITHUB_REF_NAME" --build-arg
SPACK_BRANCH=develop
# ' --label org.opencontainers.image.created="$CI_JOB_STARTED_AT"'
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
SPACK_DEPLOYMENT_KEY_PUB: ${{ secrets.SPACK_DEPLOYMENT_KEY_PUB }}
spacktainer-build-job:
runs-on:
Expand Down

0 comments on commit 8cdff1e

Please sign in to comment.