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

Dynamic dockerPath? #28

Open
vk496 opened this issue Apr 27, 2022 · 1 comment
Open

Dynamic dockerPath? #28

vk496 opened this issue Apr 27, 2022 · 1 comment

Comments

@vk496
Copy link

vk496 commented Apr 27, 2022

Hello and thanks for this project!

Right now, remote.containers.dockerPath is replaced directly in the settings.json. However, I would like to use the Docker of my system in order to do some development inside containers (podman have some incompatibilities). It is possible to use podman-host just for the current session and then restore old values? Or I had to manually change each time?

Btw: using grep and sed could make some problems (like, if I have duplicated that string and commented it would not detect it propery). Maybe switching to jq would make sure detection of the configuration is properly done.

Br,
Valentin

@owtaylor
Copy link
Owner

If you set remote.containers.dockerPath the settings.json for a workspace, I think that should override the user-level setting. Can you try that? (Presumably you'll need to change it to some sort of flatpak-spawn --host docker command)

It would also be possible for toolbox-vscode to do that - to edit settings at a workspace level instead of at a user level. There would be some issues if you, e.g, open another folder as a workspace from within VSCode - currently that stays within the toolbox correctly. I think it would end up in a not-working state if the dockerPath setting wasn't global to the user.

Most systems don't have jq installed, so I wouldn't want to use it in code.sh - if the current editing ends up being a problem, I'd probably look at using Python to do the editing. But loading the file as JSON and dumping it again will definitely lose any comments - if the parser even allows that - they aren't valid JSON. The grep/sed approach has the benefit of leaving whatever is in the file untouched - comments, formatting, etc.

P.S. - generally speaking my experience with Podman is that it is highly compatible. Would certainly encourage trying to stick with podman if possible rather than running multiple container runtimes on a system, duplicating pulling images, etc. Not saying that there aren't situations where using docker might be necessary - if you were running your containers via docker-compose or something. But I would start off from the assumption that podman does just work.

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

No branches or pull requests

2 participants