Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: allow specifying Kaniko targets for multi-stage dockerfiles#436

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hamishc wants to merge3 commits intocoder:main
base:main
Choose a base branch
Loading
fromhamishc:kaniko-skip-unused

Conversation

hamishc
Copy link

@hamishchamishc commentedDec 16, 2024
edited
Loading

I've encountered issues with large multi-stage dockerfiles when targeting one particular stage. For example, if we have a devcontainer.json like

{    "name": "envbuilder",    "build": {"dockerfile": "Dockerfile","args": {},        "target": "devenv"},}

and a Dockerfile as the following

FROM alpine AS runtime-depsFROM runtime-deps AS devenvFROM runtime-deps AS long-build-stageCOPY some-build-artifact/ /

then runningdocker run -it -v /my/repo:/workspaces/empty coder/envbuilder:latest will result in the following error

Failed to build: do build: error building stage: failed to get files used from context: failed to get fileinfo for /workspaces/empty/.devcontainer/some-build-artifact: lstat /workspaces/empty/.devcontainer/some-build-artifact: no such file or directoryFalling back to the default image...error: do build: error building stage: failed to get files used from context: failed to get fileinfo for /workspaces/empty/.devcontainer/some-build-artifact: lstat /workspaces/empty/.devcontainer/some-build-artifact: no such file or directory: no fallback image has been specifiederror: running command "envbuilder": do build: error building stage: failed to get files used from context: failed to get fileinfo for /workspaces/empty/.devcontainer/some-build-artifact: lstat /workspaces/empty/.devcontainer/some-build-artifact: no such file or directory:    github.com/coder/envbuilder.run.func4        /home/hamish/code/envbuilder/envbuilder.go:271  - no fallback image has been specified

This is because we don't specify the build target inKanikoOptions. Specifying this option can also substantially decrease build times, especially when combined with theSkipUnusedStages option - which can allow for large unused build stages to be avoided entirely.

@hamishc
Copy link
Author

Any chance getting this reviewed sometime soon? This is blocking the adoption of coder for our org, as we rely on multi-stage dockerfiles and devcontainers for most of our repositories.

@bedaberner
Copy link

I would also love to get this.
As far as I can tell, currently it just takes the last stage?
Really weird behavior when you are used to native devcontainer development.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hamishc@bedaberner

[8]ページ先頭

©2009-2025 Movatter.jp