Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker related steps after login-action don't work with no basic auth credentials #97

Closed
mdedetrich opened this issue Aug 26, 2021 · 5 comments

Comments

@mdedetrich
Copy link

Behavior

Steps to reproduce this issue

  1. Have an already existing docker login using echo ${GITHUB_TOKEN} | docker login docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
  2. Change it so it uses login-action github action
  3. Create a pull request out of it

Expected behaviour

A successful docker-login persists the login information so later docker-compose works succesfully

Actual behaviour

Docker login happened successfully however the next step in the pipeline docker-compose up -d fails to execute with no basic auth credentials.

Configuration

# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Continuous Integration

on:
  pull_request:
    branches: ['**']
  push:
    branches: ['**']

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  build:
    name: Build and Test
    strategy:
      matrix:
        os: [ubuntu-latest]
        scala: [2.12.11, 2.13.4]
        java: [[email protected]]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout current branch (full)
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Setup Java and Scala
        uses: olafurpg/setup-scala@v12
        with:
          java-version: ${{ matrix.java }}

      - name: Cache sbt
        uses: actions/cache@v2
        with:
          path: |
            ~/.sbt
            ~/.ivy2/cache
            ~/.coursier/cache/v1
            ~/.cache/coursier/v1
            ~/AppData/Local/Coursier/Cache/v1
            ~/Library/Caches/Coursier/v1
          key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

      - name: Check that workflows are up to date
        run: sbt ++${{ matrix.scala }} githubWorkflowCheck

      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Launch Nakadi
        run: docker-compose up -d

      - name: Build project
        run: sbt ++${{ matrix.scala }} clean coverage test

      - name: Upload coverage data to Coveralls
        env:
          COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COVERALLS_FLAG_NAME: Scala ${{ matrix.scala }}
        run: sbt ++${{ matrix.scala }} coverageReport coverageAggregate coveralls

      - name: Shut down Nakadi
        run: docker-compose down

Logs

logs_71.zip

@crazy-max
Copy link
Member

@mdedetrich Looks like docker-compose doesn't use the auth config as it should. Looks similar to:

You could try:

      - name: Launch Nakadi
        run: |
          docker-compose pull
          docker-compose up -d

@mdedetrich
Copy link
Author

@crazy-max So I tried as you suggested and its still not working, you can see the latest results at https://github.com/zalando-nakadi/kanadi/pull/185/checks?check_run_id=3489723413, the PR has also been updated at https://github.com/zalando-nakadi/kanadi/pull/185/files

@mdedetrich
Copy link
Author

mdedetrich commented Sep 2, 2021

@crazy-max Figured out the issue, the problem is that github containers changed the domain for their registry to docker.pkg.github.com, now its working. Will setup a PR for the README.md to update this

@crazy-max
Copy link
Member

crazy-max commented Sep 2, 2021

@mdedetrich

@crazy-max Figured out the issue, the problem is that github containers changed the domain for their registry to docker.pkg.github.com, now its working. Will setup a PR for the README.md to update this

Oh ok didn't see you use docker.pkg.github.com. This registry is deprecated and will sunset this year. I suggest to migrate to GitHub Container Registry instead. See also https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility.

@mdedetrich
Copy link
Author

Thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants