Coder Social home page Coder Social logo

Comments (10)

santiDotIO avatar santiDotIO commented on May 31, 2024 1

I think at least this should be a documented for deploying ECR or the Github registry

Thank you for your swift response!

from publish-docker-github-action.

elgohr avatar elgohr commented on May 31, 2024

I just updated the ECR action to use action.yml (as Dockerfile labels don't work since yesterday).
Could you please retry and also try a hardcoded registry?

from publish-docker-github-action.

elgohr avatar elgohr commented on May 31, 2024

If that doesn't help, it would be great, if you could provide feedback on what happens, if you use the Docker from https://github.com/elgohr/ecr-login-action locally.
Sadly I can't help directly, as I'm not using ECR.

from publish-docker-github-action.

santiDotIO avatar santiDotIO commented on May 31, 2024

I see the issues, the DOCKERNAME isn't prefixing the registry
https://github.com/elgohr/Publish-Docker-Github-Action/blob/master/entrypoint.sh#L12

So here when you push it doesn't have a reference to the custom registry
https://github.com/elgohr/Publish-Docker-Github-Action/blob/master/entrypoint.sh#L123

I think either need to add the registry to DOCKERNAME if registry is defined or add it to the push funtion

from publish-docker-github-action.

elgohr avatar elgohr commented on May 31, 2024

Ok, so you were able to fix it by providing name with the registry?
I'm not sure about adding it in the action automatically, but I'll think about that. Sadly this would be a breaking change...

from publish-docker-github-action.

elgohr avatar elgohr commented on May 31, 2024

Thank you for the feedback.
I think I'll add the registry, if the name doesn't contain it. In this way it wouldn't be breaking

from publish-docker-github-action.

andrewcstewart avatar andrewcstewart commented on May 31, 2024

Experiencing the same issue and not exactly following what the fix is? (or is it better to wait on an incoming update?)

from publish-docker-github-action.

santiDotIO avatar santiDotIO commented on May 31, 2024

@elgohr recently publish an update, now it will work as expected when you define the registry attribute, so for example,

- name: Publish to Registry
      uses: elgohr/[email protected]
      with:
        name: `[BUCKET]`/`[IMAGE_NAME]`
        username: ${{ steps.ecr.outputs.username }}
        password: ${{ steps.ecr.outputs.password }}
        registry: `[ECR_REGISTRY_ID]`.dkr.ecr.us-east-1.amazonaws.com

the abvove will compile your image and also push to [ECR_REGISTRY_ID].dkr.ecr.us-east-1.amazonaws.com/[BUCKET]/[IMAGE_NAME]

Hope that helps

from publish-docker-github-action.

andrewcstewart avatar andrewcstewart commented on May 31, 2024

Hmm, I think I'm even more confused now. My ECR repo URI doesn't have two parts at the end:

[ECR_REGISTRY_ID].dkr.ecr.us-east-1.amazonaws.com/[BUCKET]/[IMAGE_NAME]

Unless that is supposed to be [ECR_REGISTRY_ID].dkr.ecr.us-east-1.amazonaws.com/[IMAGE_NAME]:[TAG] ??

Why is registry: ${{ steps.ecr.outputs.registry }} no longer valid?

My entire action looks like this:

name: docker
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Login to ECR
      id: ecr
      uses: elgohr/ecr-login-action@master
      with:
        access_key: ${{ secrets.AWS_ACCESS_KEY }}
        secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        region: us-west-2
    - name: Publish to Registry
      uses: elgohr/[email protected]
      with:
        name: myregistry.dkr.ecr.us-west-2.amazonaws.com/myimage
        username: ${{ steps.ecr.outputs.username }}
        password: ${{ steps.ecr.outputs.password }}
        registry: ${{ steps.ecr.outputs.registry }}

from publish-docker-github-action.

andrewcstewart avatar andrewcstewart commented on May 31, 2024

Aha, I spoke too soon. I see the difference now.

from publish-docker-github-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.