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

Alllow features to copy from another images (infer devcontainer dockerfiel)#516

ThePlenkov started this conversation inIdeas
Discussion options

Hi!

Let's assume we have a feature Z which installs Z command with a script.

Let's assume this script takes few minutes to update dependencies and install/build the package.

If we use feature + we develop something in a remote container, rebuilding the container would require us to wait for this feature to be installed again and again.

At same time let's say there is already another container where Z is already installed and avilable as compiled executable file.

So copying this file from prebuilt container would be enough.

So what I do now in my docker file:

FROM z_image as zFROM devcontainers/nodeCOPY --from z /path/to/z /target/path/to/bin....

This approach may save me hours a month only by reducing build time, copy happens immediately, moreover because it's a docker image - this image won't be downloaded again and again - it will take it from cache.

So instead of minutes i spend now less than a second to copy 1 file.

Now let's get back to features. If feature is used ( this is how I understand ) - it will run install.sh in the already built image.

So image rebuild would defintely trigger all features reinstallation.

At same time only if we could to have another API from a feature definition where we could inject certain lines in a generated devcontainer Dockerfile - then this problem wouldn't exists.

We could insert RUN, COPY, FROM commands as we would do this in own custom Dcokerfile.

What do you think of this approach?

Thanks!

You must be logged in to vote

Replies: 1 comment

Comment options

Actually I have one real example:

FROM mcr.microsoft.com/devcontainers/typescript-node:1-22-bookwormCOPY --from=cloudfoundry/cli /usr/local/bin/cf /usr/local/bin/cf

I'd like to achieve something like this with a feature without creating Dockerfile. Is it possible?

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
1 participant
@ThePlenkov

[8]ページ先頭

©2009-2025 Movatter.jp