mr-smithers-excellent / docker-build-push

Docker Build & Push GitHub Action
MIT License
278 stars 62 forks source link

Feature request: passing in build arguments #6

Closed arokem closed 4 years ago

arokem commented 4 years ago

Thanks for creating this action!

I would like to pass not one, but multiple build arguments to the docker build step.

I am guessing you'd have to make some changes here, to pass in additional arguments to this function, but not sure I dare try doing this myself. WDYT?

mr-smithers-excellent commented 4 years ago

Hi @arokem - thanks for the feature request.

Definitely happy to give this a shot. Can you give me an example of what your docker build command looks like?

arokem commented 4 years ago

Well, that was fast! 😄

Something like this: https://github.com/nipreps/dmriprep/blob/master/.circleci/config.yml#L93-L98

mr-smithers-excellent commented 4 years ago

Got it. Would you want to add a --cache-from param as well?

arokem commented 4 years ago

No - we probably want to remove that anyway.

On Tue, Jan 14, 2020 at 1:44 PM Sean Smith notifications@github.com wrote:

Got it. Would you want to add a --cache-from param as well?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mr-smithers-excellent/docker-build-push/issues/6?email_source=notifications&email_token=AAA46NRZW6WYQKDBCLWRDVDQ5YW5FA5CNFSM4KGYVN72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI6HTAA#issuecomment-574388608, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA46NQ5KEFYPMTNWZC7SQTQ5YW5FANCNFSM4KGYVN7Q .

mr-smithers-excellent commented 4 years ago

I can take a crack at this tonight - I don't foresee it being very difficult.

mr-smithers-excellent commented 4 years ago

Can you give your build a try using the following config sample?

name: Docker Build & Push

on: [push]

jobs:

  build-and-push:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
      name: Check out code

    - uses: mr-smithers-excellent/docker-build-push@feature/add-build-args
      name: Build & push Docker image
      with:
        image: 'mrsmithers/hello-world'
        tag: 'latest'
        registry: 'docker.io'
        buildArgs: 'VERSION=1.0,BUILD_DATE=2020-01-08'
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
arokem commented 4 years ago

I'm getting this error: https://github.com/arokem/dmriprep/commit/079a3b2729b1f51f694b2ca5798e439d563313a0/checks?check_suite_id=401335463

mr-smithers-excellent commented 4 years ago

I'm wondering if the buffer on the child_process is getting overloaded. I've honestly never seen a Docker build take as long as this one, so that's my first inclination. Did docker build work on the master version of this GH Action? I'm doubting that the build-args would have caused this error, but want to be sure.

arokem commented 4 years ago

Yeah. It's a pretty long docker build (science is hard!), but it does work with a more explicit version of the workflow: https://github.com/arokem/dmriprep/commit/f9c966e3934d4bfd4d9d067b83185f042d6c9c8e/checks?check_suite_id=401371812

We might have to give up on using your action anyway, because (as you can see in that PR), we need some rather granular control of the build and pushing. Sorry for the noise.

On Tue, Jan 14, 2020 at 10:36 PM Sean Smith notifications@github.com wrote:

I'm wondering if the buffer on the child_process is getting overloaded. I've honestly never seen a Docker build take as long as this one, so that's my first inclination. Did docker build work on the master version of this GH Action? I'm doubting that the build-args would have caused this error, but want to be sure.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mr-smithers-excellent/docker-build-push/issues/6?email_source=notifications&email_token=AAA46NR3HBK2L3QMC64UWH3Q52VHBA5CNFSM4KGYVN72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI7HHGQ#issuecomment-574518170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA46NQEMHX4EFR5JBGG3SLQ52VHBANCNFSM4KGYVN7Q .

mr-smithers-excellent commented 4 years ago

Looks like some pretty interesting (and meaningful) work you're tackling there!

Even if you don't end up using it, I'm now intrigued by the problem and want to solve it. I've forked that repo and am going to adjust the buffer settings to see if that's the issue.

mr-smithers-excellent commented 4 years ago

Increasing the buffer size appears to have fixed this issue. See this build.

I'll be incorporating these changes into a new release (even if you won't be using it). Let me know if there are any other feature requests. I definitely want this GH Action to be versatile.

arokem commented 4 years ago

Thank you!