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

Feature request - Support overlays #50

Open
juanzolotoochin opened this issue Feb 27, 2024 · 1 comment
Open

Feature request - Support overlays #50

juanzolotoochin opened this issue Feb 27, 2024 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@juanzolotoochin
Copy link

Looking at this example: https://github.com/chainguard-dev/apko/blob/main/examples/overlay.yaml

This doesn't work with bazel because the base yamls are not included in the build. Given something like this:

# apko.yaml
include: base/base.yaml

contents:
  packages:
    - python3
apko_image(
    name = "py_base",
    architecture = select({
        "@platforms//cpu:arm64": "arm64",
        "@platforms//cpu:x86_64": "amd64",
    }),
    config = "apko.yaml",
    contents = "@apko_py_base//:contents",
    tag = "wolfi:latest",
)

Fails to build with:

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
:information_source:            | loading config file: /py_base/apko.yaml
:information_source:            | including base/base.yaml for configuration
⚠            | remote configurations are an experimental feature and subject to change.
Error: failed to load image configuration: failed to read include file: unable to fetch remote include from git: failed to clone /base/base.yaml: Get "https://bazel/apko/base_images/info/refs?service=git-upload-pack": dial tcp: lookup bazel on 172.17.0.1:53: no such host
2024/02/27 13:59:31 error during command execution: failed to load image configuration: failed to read include file: unable to fetch remote include from git: failed to clone /base/base.yaml: Get "https://bazel/apko/base_images/info/refs?service=git-upload-pack": dial tcp: lookup bazel on 172.17.0.1:53: no such host
Target //py_base:py_base failed to build
Use --verbose_failures to see the command lines of failed build steps.

Sounds like we should be able to provide deps to the build like:

apko_image(
    name = "py_base",
    architecture = select({
        "@platforms//cpu:arm64": "arm64",
        "@platforms//cpu:x86_64": "amd64",
    }),
    config = "apko.yaml",
    deps = ["//base:base.yaml"],
    contents = "@apko_py_base//:contents",
    tag = "wolfi:latest",
)
@thesayyn thesayyn added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Feb 27, 2024
@sfc-gh-mhazy
Copy link
Contributor

Should be fixed by #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants