-
Notifications
You must be signed in to change notification settings - Fork 785
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
[RFE] Add support for --link
in COPY/ADD
#4325
Comments
--link
in COPY/ADD
--link
in COPY/ADD
Hello @lucacome and @TomSweeneyRedHat, I want to contribute to this issue but am new to the project, How can I get started? :) |
Well first you would need to add support for --link in |
Hi, Yes implementation must start from imagebuilder and introduce a new attribute COPY --link /src /target must create a intermediate image equivalent to FROM scatch
COPY /src /target |
I was wondering if you've had a chance to start working on this? Or do you need any help? 🙂 |
Really sorry about this, I had gotten a little busy with college work. I'll start work asap by this Saturday. |
No problem college work should come first. |
Hello everyone, really sorry again for stalling this issue. Ok Here's what I understand from the documentation of the
Here's how I understand how I need to implement it:
Please check if this is correct |
Yes SGTM. Pretty much what's written here #4325 (comment) but I'd suggest if you have time to take a look and play with buildkit a bit before implementing this. My explanation in above comment is more conceptual and in past we have seen that buildkit's feature is not completely described in the documentation so its worth verifying edge cases before implementing this. Note: Buildah mostly tries to match parity with buildkit as much as possible. |
Sure. I need to try both the tools first i guess. Would be interesting. I'll try my best to help this issue :) |
A friendly reminder that this issue had no activity for 30 days. |
Alright I researched quite a bit about rootfs and build root for the few weeks. I feel comfortable with linux rootfs and how it works. Um, if you don't mind guys (@flouthoc and @rhatdan) can you please help me point out how buildah handles creating scratch rootfs? (in addition line number would be very cool) |
@CypherpunkSamurai Its hard to pin the exact line since I'll have to skim the code but I can tell that builder creates a container for |
A friendly reminder that this issue had no activity for 30 days. |
Since we have not heard any more feedback, closing. Reopen if you want to continue looking into this one. |
@rhatdan I'm still interested in this and I'd like to keep it open. Maybe somebody else can take over from @CypherpunkSamurai ? |
@CypherpunkSamurai If you are running short on time, I'd request to assign this issue to me :) |
Sure. I'm having my exams right now, probably not a great time to work on
this. I better not keep this issue stalling :)
…On 24 January 2023 10:18:08 AM flouthoc ***@***.***> wrote:
@CypherpunkSamurai If you are running short on time, I'd request to assign
this issue to me :)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This removes some docker/buildkit-specific lines that break on Podman... for now. See: containers/buildah#4325 containers/buildah#3815 This is a painful patch, but without using another Dockerfile for Podman, I couldnt find a non-convoluted alternative.
A friendly reminder that this issue had no activity for 30 days. |
not supported by openshift CI (buildah) See containers/buildah#4325
not supported by openshift CI (buildah) See containers/buildah#4325
@flouthoc If you haven't started, I can take a shot at this. |
- get rid of --link flags for COPY operations: not supported by openshift CI (buildah) See containers/buildah#4325 - get rid of conda - install ccache to leverage caching
- get rid of --link flags for COPY operations: not supported by openshift CI (buildah) See containers/buildah#4325 - get rid of conda - install ccache to leverage caching
not supported by openshift CI (buildah) See containers/buildah#4325
not supported by openshift CI (buildah) See containers/buildah#4325
@danishprakash go for it. @flouthoc has gone back to school and has much less time to work on this. |
Any updates on this one? |
I'd love to see this as well. But I am kinda wondering if it makes sense to reimplement what buildkit does instead of using/embedding buildkit in podman? FWIW, aside from being daemonless (though you kind of can run buildkit like that as well: https://github.com/moby/buildkit?tab=readme-ov-file#daemonless ) podman build imo no longer has any features over docker build(x). The performance gains with buildkits are so big that I am currently reworking a few of our internal pipelines to use buildkit. |
@apollo13 Could you please elaborate on this, |
@flouthoc I was mainly wondering if it makes sense (or were possible) for podman to directly use buildkit instead of buildah. This would allow keeping feature parity more easily and also pick up all performance improvements. Especially with multi stage builds podman is really really much slower since buildkit is able to parallelize many things (unless I missed a flag for podman build) |
Podman multi-stage build is parallel but you have to use |
Oh thank you, how did I miss that (is it new?). That does indeed help for multi-stage builds. Can you recommend any other knobs to tune?
…On Sun, Aug 18, 2024, at 22:17, flouthoc wrote:
Podman multi-stage build is parallel but you have to use `--jobs` flag.
See
https://docs.podman.io/en/latest/markdown/podman-build.1.html#jobs-number
—
Reply to this email directly, view it on GitHub
<#4325 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAT5C7QBYVLOL3FLASV2D3ZSD6OBAVCNFSM6AAAAAAQ72EQZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGM3TQMJWGM>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Would it be sensible to silently ignore From the flag description, it sounds like it is an optimization for cache reuse, but missing a cache reuse opportunity is not a big deal. On the other hand, if there is a requirement that the layer checksums are exactly the same between Buildah and BuildKit, I don't know for certain if ignoring |
It's not but it's also not good design when we support an option for the sake of docker compat, and it might be misleading to users and might impact workflow. That being said, I'll start working on this in a week or two, but in the meantime, @rhatdan thoughts on adding dummy flags? A similar sentiment was shared regarding |
If COPY/ADD --link will be initially supported only syntactically, could a warning be emitted to stderr notifying users that |
I would be fine with adding a warning, but it would be best if someone would step up and add the functionality. |
By default, all I've reproduced that on my Currently, I haven't found any workarounds on how to successfully execute these gradle tasks against the In the case of FROM eclipse-temurin:21-jre
WORKDIR /home/app
COPY --link layers/libs /home/app/libs
COPY --link layers/app /home/app/
COPY --link layers/resources /home/app/resources
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/home/app/application.jar"] and respectively, the job failed with the following error:
Analogously, in the case of FROM ghcr.io/graalvm/native-image-community:23-ol9 AS graalvm
WORKDIR /home/app
COPY --link layers/libs /home/app/libs
COPY --link layers/app /home/app/
COPY --link layers/resources /home/app/resources
RUN mkdir /home/app/config-dirs
RUN mkdir -p /home/app/config-dirs/generateResourcesConfigFile
RUN mkdir -p /home/app/config-dirs/io.netty/netty-common/4.1.80.Final
RUN mkdir -p /home/app/config-dirs/ch.qos.logback/logback-classic/1.4.9
COPY --link config-dirs/generateResourcesConfigFile /home/app/config-dirs/generateResourcesConfigFile
COPY --link config-dirs/io.netty/netty-common/4.1.80.Final /home/app/config-dirs/io.netty/netty-common/4.1.80.Final
COPY --link config-dirs/ch.qos.logback/logback-classic/1.4.9 /home/app/config-dirs/ch.qos.logback/logback-classic/1.4.9
RUN native-image --exclude-config .*/libs/netty-codec-http-4.1.115.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-codec-http2-4.1.115.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-buffer-4.1.115.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-handler-4.1.115.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-transport-4.1.115.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-common-4.1.115.Final.jar ^/META-INF/native-image/.* -cp /home/app/libs/*.jar:/home/app/resources:/home/app/application.jar --no-fallback -o application -H:ConfigurationFileDirectories=/home/app/config-dirs/generateResourcesConfigFile,/home/app/config-dirs/io.netty/netty-buffer/4.1.80.Final,/home/app/config-dirs/io.netty/netty-common/4.1.80.Final,/home/app/config-dirs/io.netty/netty-transport/4.1.80.Final,/home/app/config-dirs/io.netty/netty-codec-http/4.1.80.Final,/home/app/config-dirs/io.netty/netty-handler/4.1.80.Final,/home/app/config-dirs/io.netty/netty-codec-http2/4.1.80.Final,/home/app/config-dirs/ch.qos.logback/logback-classic/1.4.9 villa.estate.automation.VillaEstateAutomation
FROM cgr.dev/chainguard/wolfi-base:latest
EXPOSE 8080
COPY --link --from=graalvm /home/app/application /app/application
ENTRYPOINT ["/app/application"] and that job was failed as well with the following error:
|
Description
Buildkit added support for the
--link
flag. Quoting from the docs:This is a feature request to add this feature in buildah 🙂
The text was updated successfully, but these errors were encountered: