Skip to content
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

Allow Network Host #252

Closed
fnacarellidev opened this issue Oct 2, 2024 · 11 comments · Fixed by #253
Closed

Allow Network Host #252

fnacarellidev opened this issue Oct 2, 2024 · 11 comments · Fixed by #253
Labels
kind/enhancement New feature or request

Comments

@fnacarellidev
Copy link

Description

Is there any way to specify the --allow=network.host flag to bake without manually running the command? I tried using the entitlements field, but it didn't work, didn't find anything other than that that seems to be related with the problem I'm having:

image

@crazy-max
Copy link
Member

Can you create a bug report and provide a link to your repo or give us a small repro please?

@fnacarellidev
Copy link
Author

@crazy-max thank you for the fast reply. Do you know if there's a way to pass this --allow=network.host through the bake yml?

@crazy-max
Copy link
Member

@crazy-max thank you for the fast reply. Do you know if there's a way to pass this --allow=network.host through the bake yml?

You can't enforce within the bake definition but you can with --allow flag in bake but we need to add this input to this action sorry for this oversight!

@fnacarellidev
Copy link
Author

Ah I see, so that's not available yet, I look forward into contributing to open-source projects, do you think it would be too hard to implement that? If you can maybe assist me I would like to try :)

@fnacarellidev
Copy link
Author

Maybe add an option like buildkitd-flags on https://github.com/docker/setup-buildx-action?tab=readme-ov-file#customizing, I think that would solve the issue, wouldn't it?

@crazy-max
Copy link
Member

Ah I see, so that's not available yet, I look forward into contributing to open-source projects, do you think it would be too hard to implement that? If you can maybe assist me I would like to try :)

Thanks but already opened one #253 sorry 😅

Maybe add an option like buildkitd-flags on https://github.com/docker/setup-buildx-action?tab=readme-ov-file#customizing, I think that would solve the issue, wouldn't it?

No, the inputs action should have the same UX as the bake command, see https://docs.docker.com/reference/cli/docker/buildx/bake/. In this case we need an allow input.

@crazy-max
Copy link
Member

@fnacarellidev Btw can you create a repro for your issue or share your bake definition?

@fnacarellidev
Copy link
Author

Sure, this is my current bake definition:

- name: bake integrate
        uses: docker/bake-action@v5
        with:
          push: false
          load: true
          targets: integrate
          workdir: ${{ matrix.package }}
          files: |-
            compose.yaml
            compose-cache.json

compose.yml:

services:
  integrate:
    command: "true"
    build:
      context: ../..
      dockerfile: svcs/books/Dockerfile
      network: host
      target: integrate

compose-cache.json:

{
    "target": {
      "integrate": {
        "cache-from": [
          "type=gha,scope=ci-Linux-X64-devserver",
          "type=gha,scope=ci-Linux-X64-svcs-books-integrate"
        ],
        "cache-to": [
          "type=gha,scope=ci-Linux-X64-svcs-books-integrate"
        ],
        "output": [
          "type=docker"
        ]
      }
   }
}

@fnacarellidev
Copy link
Author

@crazy-max I need to wait for the next release to use that, right?

@crazy-max
Copy link
Member

@crazy-max I need to wait for the next release to use that, right?

Should be good now https://github.com/docker/bake-action/releases/tag/v5.10.0

@fnacarellidev
Copy link
Author

It worked perfectly, thank you @crazy-max, also, if you have any task that needs to be done and it's a good first issue, please contact me, I'm very interested into contributing to open-source projects :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants