redhat-actions / push-to-registry

GitHub Action to push a container image to an image registry.
https://github.com/marketplace/actions/push-to-registry
MIT License
100 stars 33 forks source link

Test with other registries #3

Closed lstocchi closed 3 years ago

lstocchi commented 4 years ago

The action has already been tested by pushing docker/oci images to a Quay registry.

This needs to be tested with

lstocchi commented 3 years ago

Tried with both and it works fine. Maybe i just need to add an input to set the tls-verify to false for openshift registry as in crc i get this error "x509: certificate signed by unknown authority"

For an internal OpenShift registry the values needed are:

- name: Push To Quay
      uses: redhat-actions/push-to-registry@v1
      with:
        image: ${{ env.IMAGE_NAME }}
        registry: ${{ secrets.OPENSHIFT_REGISTRY }} // something like  default-route-openshift-image-registry.apps-crc.testing/projectname
        username: ${{ secrets.OPENSHIFT_USERNAME }} // classic username used to login in openshift
        password: ${{ secrets.OPENSHIFT_TOKEN }} // the openshift token (not working by using the password)

What we need to mention is that the user need to have some specific roles to push/pull to the registry https://docs.openshift.com/container-platform/3.9/install_config/registry/accessing_registry.html#access-user-prerequisites

For dockerhub, the same as quay.io

- name: Push To Quay
      uses: redhat-actions/push-to-registry@v1
      with:
        image: ${{ env.IMAGE_NAME }}
        registry: ${{ secrets.DOCKER_REPO }} //docker.io/username
        username: ${{ secrets.DOCKER_USERNAME }} 
        password: ${{ secrets.DOCKER_TOKEN }}
divyansh42 commented 3 years ago

Can we also provide examples (of pushing to different registries) for few of them? Does it makes sense?

tetchel commented 3 years ago

Closing this because Divyanshu verified the OpenShift Registry, and I verified GHCR.