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

dockerfile: add support for ONBUILD in combination with from #5357

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tonistiigi
Copy link
Member

This adds support for the ONBUILD commands to refer to
other stages in commands like COPY --from= or
RUN --mount=from= . The source may be a stage in the
calling Dockerfile, implicit image or named build context.

depends on #5349
fixes #4568 (comment)
fixes #959
fixes #816
fixes #817

This avoids many temporary conversion between maps/slices
and shell.EnvGetter.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi tonistiigi changed the title dockerfile: add support for ONBUILD in combination to from dockerfile: add support for ONBUILD in combination with from Sep 24, 2024
@tonistiigi tonistiigi force-pushed the onbuild-from-support branch 2 times, most recently from 98e9189 to cac7523 Compare September 25, 2024 00:55
This adds support for the ONBUILD commands to refer to
other stages in commands like `COPY --from=` or
`RUN --mount=from=` . The source may be a stage in the
calling Dockerfile, implicit image or named build context.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@@ -4674,6 +4677,325 @@ ONBUILD RUN mkdir -p /out && echo -n 11 >> /out/foo
require.Equal(t, "11", string(dt))
}

func testOnBuildNamedContext(t *testing.T, sb integration.Sandbox) {
integration.SkipOnPlatform(t, "windows")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will try it on Windows once #5289 lands. /cc. @billywr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants