Use docker image from GitHub Packages as container

I’d like to use a public Docker image available on GitHub Package in the field jobs.<job_id>.container:

name: CI

on:
  push:
    branches:
      - master

jobs:
  job_build:
    name: Build
    runs-on: ubuntu-latest

    container:
      image: docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:latest

    steps:
      - name: Clone
        uses: actions/checkout@v2

      - name: Build
        run: |
          make

      - name: Upload bin
        uses: actions/upload-artifact@v2
        with:
          name: bin
          path: bin

I guess I need to put ${{ secrets.GITHUB_TOKEN }} somewhere but there is no field for that in the doc: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer.

Is it even possible to do that?

@lambda-xyz
I am afraid I have to tell you that GitHub Actions doesn’t support using image from GitHub Package Registry for Container currently.
There are some other communities who asked for this feature before. And GitHub Engineering team is trying to find a way to provide credential to daemon when pulling image from registry.
You could also ask for this feature in the Feedback form for GitHub Actions to improve the priority of it.

1 Like

Wow, this is a very basic feature…

Hope to see it soon!

Thanks.

1 Like