jupyterhub / repo2docker-action

A GitHub action to build data science environment images with repo2docker and push them to registries.
MIT License
142 stars 28 forks source link

Support and document pushing to AWS ECR #65

Closed yuvipanda closed 3 years ago

yuvipanda commented 3 years ago

Description

I want to automatically build and push images to a repository that uses docker credential stores rather than username / password to log in. This is not a documented use-case of this repository, so it's unclear whether it is supported or not.

To start off, let's try getting this action to work with Amazon ECR, as this is a very common registry to use as a test case.

Benefit

This would be valuable because many container registries don't user U/P credentialing (like AWS ECR). Documenting this process for one of them would make it easier for others to understand how they could apply it to other registries.

Implementation

We could test this out by following the Amazon ECR action here:

https://github.com/aws-actions/amazon-ecr-login#usage

Tasks

Alternative approaches

Install repo2docker manually and push, which I've done in https://github.com/amfriesz/lpdaac_hls_tutorial/pull/2.

welcome[bot] commented 3 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

choldgraf commented 3 years ago

@yuvipanda has this been closed by https://github.com/jupyterhub/repo2docker-action/issues/70 ?

choldgraf commented 3 years ago

I've updated the top comment on this one, as I think that it was worded a little unclearly. It's not focused on documenting how to set up on Amazon ECR as a test-case so that others have a concrete example to follow for other registries as well.

consideRatio commented 3 years ago

Here is an example of providing credentials, configuring docker to use them, and then doing a docker push with them.

https://github.com/pangeo-data/jupyter-earth/blob/8d2f1b03202158c863ff077dc04c07ec695e355f/.github/workflows/build-image.yaml#L49-L79

GeorgianaElena commented 3 years ago

Finally concluded that the action does indeed work with pushing to an Amazon ECR registry :tada:

I have a working example in this repo here. Note that DOCKER_CONFIG needs to be set in order for repo2docker-action to know where to find the credentials stored in previous steps. (ref: https://github.com/docker/login-action/issues/34)

Without this, pushing the image fails with no basic auth credentials.

(thanks @sgibson91 for pointing me to docker/build-push-action, this was where the quest started from)