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

Customize/override bootstrap.Dockerfile #8102

Open
PvanHengel opened this issue Feb 25, 2023 · 13 comments
Open

Customize/override bootstrap.Dockerfile #8102

PvanHengel opened this issue Feb 25, 2023 · 13 comments
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Milestone

Comments

@PvanHengel
Copy link

As an enterprise developer that uses devcontainers, I need to add custom root certificates using a script file in the bootstrap docker file used to bootstrap (git clone) source code into the true dev container. Without these root certificates in the docker image installed via a custom script there is no way to clone the repo.

One can modify the bootstrap.Dockerfile in the users .vscode folder, which gets copied into the /var/... location before building, helper scripts placed there are not available to be added to the base image. A more robust system for making modifications to the root image, or a system setting to override the bootstrap image used (that ideally persists as versions of the extension are upgraded as well) is required.

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Feb 25, 2023
@chrmarti chrmarti self-assigned this Mar 8, 2023
@chrmarti chrmarti added the feature-request Request for new features or functionality label Mar 8, 2023
@chrmarti chrmarti added this to the Backlog milestone Mar 8, 2023
@PvanHengel
Copy link
Author

Any update when this might be able to be looked at, its a blocker at this point and really are unable to make any progress due to the root certificates not being inside the bootstrapping image used to clone and create the volume. Ive been hacking around and cannot reliably create any solution that would work across multiple developer machines.

@pootow
Copy link

pootow commented Jul 28, 2023

#3809 can also use this feature, what we really want is to run devcontainer in a network restricted area, so we can inject proxies, mirrors and such other envs etc into the Dockerfile.

@francoissharpe
Copy link

Even simply being able to specify the base image used by the clone and recovery container in the settings, would at least allow us to push the preconfigured image to our internal registry and have it work.

@chrmarti
Copy link
Contributor

@PvanHengel The latest pre-releases (currently Dev Containers 0.344.0-pre-release) loads the system certificates into the bootstrap container. Could you give that a try? (Tracked as #6092.)

@kimidaisuki22
Copy link

I know this is bad, but the customize can be done by replacing the file content under ~/.vscode/extensions/ms-vscode-remote.remote-containers-{version}/scripts/bootstrap.Dockerfile

@chrmarti
Copy link
Contributor

chrmarti commented Mar 5, 2024

What are the other use-cases for overriding this Dockerfile aside from loading root certificates? Ideally everything would just work out-of-the-box, so I'd be interested if we can improve on that before we make the Dockerfile configurable.

@kimidaisuki22
Copy link

What are the other use-cases for overriding this Dockerfile aside from loading root certificates? Ideally everything would just work out-of-the-box, so I'd be interested if we can improve on that before we make the Dockerfile configurable.

It may not a problem about Dockerfile configurable: clone repo into volume is handy, but volume-bootstrap is slow to build in my network, for me I just prebuild it in the background and then fetch it from LAN when I use it.

I have tried to simply replace the build file, but it has a more complex image than I think, so I just give up.
And I think the customize just adds more cost for both users and the dev team and not enough benefit.

Maybe an addition Dockerfile can be added to build final image onto current boostrap image, it is easier to maintain and add some customization for end users.

@PvanHengel
Copy link
Author

use-cases for overriding this Dockerfile aside from loading root certificates? Ideally everything would just work out-of-the-box, so I'd be interested if we can improve on that before we ma

What are the other use-cases for overriding this Dockerfile aside from loading root certificates? Ideally everything would just work out-of-the-box, so I'd be interested if we can improve on that before we make the Dockerfile configurable.

Another use case might be setting up the openssl.conf file, hosts file, or other OS level settings that are required during the bootstrapping process.

@wanxger
Copy link

wanxger commented Apr 16, 2024

I know this is bad, but the customize can be done by replacing the file content under ~/.vscode/extensions/ms-vscode-remote.remote-containers-{version}/scripts/bootstrap.Dockerfile

I hope to be able to modify the bootstrap.Dockerfile. Due to network issues, I am unable to open the dev container smoothly. If it is not possible to overwrite the bootstrap.Dockerfile, can a custom shell be executed instead? Just the manual replacement method in the above method needs to be implemented through the shell.

@wanxger
Copy link

wanxger commented Apr 16, 2024

I know this is bad, but the customize can be done by replacing the file content under ~/.vscode/extensions/ms-vscode-remote.remote-containers-{version}/scripts/bootstrap.Dockerfile

I hope to be able to modify the bootstrap.Dockerfile. Due to network issues, I am unable to open the dev container smoothly. If it is not possible to overwrite the bootstrap.Dockerfile, can a custom shell be executed instead? Just the manual replacement method in the above method needs to be implemented through the shell.

I used a script locally to perform automatic replacements. It works, but it cannot be written once and run everywhere.

@h4de5
Copy link

h4de5 commented Jul 26, 2024

when cloning our repository (which has git-lfs and post-checkout) we always got the message to set GIT_CLONE_PROTECTION_ACTIVE=false to overcome the cloning.
the only way we found for now, was to adapt this file locally on each machine

@chrmarti
Copy link
Contributor

@h4de5 I will update the base image to mcr.microsoft.com/devcontainers/base:0-alpine-3.20 to pick up Git 2.45.2 which has a fix for your issue: git-lfs/git-lfs#5749 (comment)

@chrmarti
Copy link
Contributor

This fix is available in Dev Containers 0.381.0-pre-release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

7 participants