Replies: 3 comments 2 replies
-
Why rebuild? I may have executed a command that destroyed the usefulness of the container. Rebuilding is fast when all I have to do is remake it from the already cached Docker layers. Slow if I have to do that AND download and install features from the internet. |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing this! @craiglpeters @joshspicer I'd love to get your thoughts here, as this feels somewhat related to prebuild and Feature installation discussions we've had. |
Beta Was this translation helpful? Give feedback.
-
Hi 👋 The Feature scripts are installed immediately after the commands from the
Hence, I believe that ^ statement is incorrect. Feel free to correct me if I have misunderstood your question/scenario.
Why do you need to run the scripts within the |
Beta Was this translation helpful? Give feedback.
-
So the current design of features in the devcontainer ecosystem is that they are tacked onto the base Docker container after the container is instantiated - what I'm calling "dynamic install" for lack of a better term. For the teams I work with this has provided a problem: several of the features we need take a very long time to install, making a devcontainer very slow to build - the first time and any time after that.
Instead I created a workaround that speeds up the process at the sacrifice of getting the latest versions every rebuild:
devcontainer.json
file references either a central image built as described below, or a localDockerfile
ordocker-compose.yaml
with the same architecture. The former provides the fastest process, but the latter provides local customizability.Dockerfile
is based off of a devcontainer image that provides the majority of the needed tools, and then bakes the features into itself as layers:The sacrifice can have its benefit: a company can maintain a centrally defined well-vetted suite of devcontainer images that each individual repository just taps into. This provides opportunity for security checks as well as helping make sure that all developers, CI/CD systems, etc. are all utilizing the same tooling.
However this has had some problems of late. Recently the user env vars spec proposal was made
REMOTE_USER
aware causing my setup above to totally fail.I get that I'm using the tooling in an unexpected manner. I'd like to open up discussion about how we could make baking features into the docker images easier to accomplish and maintain - I don't expect to be able to speed up the installs of these features, they are simply massive.
Beta Was this translation helpful? Give feedback.
All reactions