Skip to content

Add github package registry example #14

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

Closed
wants to merge 1 commit into from

Conversation

zappy-shu
Copy link
Contributor

Add github package registry example

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
@zappy-shu zappy-shu requested a review from justincormack March 19, 2020 12:19
password: ${{ github.token }}
registry: docker.pkg.github.com
repository: myorg/myrepository
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be missing a third part, the package name.
Otherwise it'll fail with the following message:
name unknown: docker image push is only supported with a tag of the format :owner/:repo_name/:image_name.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still can't get it to work on github registry. Is there any workaround?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, got it to work with hard-coding the full name in the yml.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to hard-code the image name as well to get past the error.

password: ${{ github.token }}
registry: docker.pkg.github.com
repository: myorg/myrepository
Copy link

@alecgerona alecgerona May 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
repository: myorg/myrepository
repository: ${{github.repository}}/myrepository

This should get it working.
Edit: Updated to use the prebuilt Github environment variable for the repository path/name

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.repository will only work if the org/project are all characters acceptable for docker (e.g. lowercase. Have to manually input this information if that isn't the case.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure. I think the error message would output this as well, no?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails if your org or repo contains uppercase letters.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
repository: myorg/myrepository
repository: ${{github.repository}}//my-image

The last part is the image name: docker.pkg.github.com/my-owner/my-repo/my-image

@hholst80
Copy link

It is recommend to use the built in environment variable $GITHUB_REPOSITORY

@alecgerona
Copy link

alecgerona commented Jun 2, 2020 via email

JohannesRudolph added a commit to meshcloud/unipipe-service-broker that referenced this pull request Jun 18, 2020
@zappy-shu zappy-shu requested a review from crazy-max as a code owner September 8, 2020 21:16
@crazy-max
Copy link
Member

Version 2 has been merged to the main branch and is therefore available via uses: docker/build-push-action@v2 (mutable tag).

As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases.

This PR seeming obsolete for this new version, I close it. Don't hesitate if you have any questions.

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

Successfully merging this pull request may close these issues.

10 participants