Open fesm0750 opened 6 years ago
The docker socket isn't available to the flatpak sandbox. You can probably create an override for it if you really want.
Take a look here: https://www.systutorials.com/docs/linux/man/1-flatpak-override/
I got it working by running:
sudo flatpak override --system --filesystem=/run/docker.sock com.visualstudio.code
However, I cannot get the Remote Development extension for Containers to work because it requires the Docker CLI - and I cannot figure out how to make the Docker CLI available within the sandbox
@erindru How did you get this to work, I got the file override to work but but the permissions are wrong?
I can't remember (October was a long time ago) - it just worked. Possibly because my user is a member of the 'docker' group so that I can use the Docker CLI without prefixing everything with sudo
.
My user is also a member of the docker group but when it gets mapped in /run/docker.sock is owner by nfsnobody
srw-rw---- 1 nfsnobody nfsnobody 0 Jan 8 14:45 docker.sock
Did you find any other work around this would be nice to have.
I created file docker.sh with that:
#!/bin/sh
flatpak-spawn --host docker "$@"
And set path to it in config. it has many disadvantages but Remote Development extension for Containers works. This maybe long term better solution: https://github.com/containers/podman/issues/4131. Running podman in docker should be similar to running podman in flatpak sandbox.
Maybe one could ship podman-cli in the flatpak, AFAIK the service files and all the rest don't need to be installed, "just the binary", together with exposing the socket:
flatpak override --user --filesystem=xdg-run/podman com.visualstudio.code
This provides access to the unprivileged podman containers via the socket API and the binary would only need to connect to the socket.
Maybe one could ship podman-cli in the flatpak, AFAIK the service files and all the rest don't need to be installed, "just the binary", together with exposing the socket:
flatpak override --user --filesystem=xdg-run/podman com.visualstudio.code
This provides access to the unprivileged podman containers via the socket API and the binary would only need to connect to the socket.
This suggestion did get me going in a direction, and I have some error output! I was able to interact with the Podman instance on the Flatpak Host after enabling the Podman socket, but VSCode did seem to have some issues itself.
I hope this helps someone else. I think the Podman-Remote idea is the way to go in this instance.
Install Visual Studio Code and a Podman tool
➜ ~ flatpak search com.visualstudio.code
Name Description Application ID Version Branch Remotes
Visual Studio Code Visual Studio Code. Code editing. Redefined. com.visualstudio.code 1.57.1-1623936438 stable flathub-root,flathub
Visual Studio Code (Insiders) Visual Studio Code. Code editing. Redefined. com.visualstudio.code.insiders 1.61.0-1630915382 beta flathub-beta
Code - OSS Visual Studio Code. Code editing. Redefined. com.visualstudio.code-oss 1.47.2 beta flathub-beta
Podman A tool for managing OCI containers and pods com.visualstudio.code.tool.podman 3.3.1 20.08 flathub-root,flathub
fish The user-friendly command line shell com.visualstudio.code.tool.fish 3.3.1 20.08 flathub-root,flathub
Code - OSS Visual Studio Code. Code editing. Redefined. com.visualstudio.code-oss 1.60.0 stable flathub-root,flathub
➜ ~ flatpak --user install flathub com.visualstudio.code com.visualstudio.code.tool.podman
See the GitHub issue for vscode flatpak issue 55.
flatpak override --user --filesystem=xdg-run/podman com.visualstudio.code
systemctl --user enable --now podman.socket
Install the following plugins.
flatpak run --command=bash com.visualstudio.code
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
This installs the Remote Development
VSCode Plugin pack to enable Container development. Now, press CTRL+SHIF+P
and open Settings (UI). Search for docker
and replace the docker executable word with podman-remote
.
This was a little confusing at first, for some reason, I thought it would just use podman
but it provides podman-remote
.
CTRL+(backtick)
to launch terminal.podman-remote container ls
This should show the list of Container Images, if any.
.devcontainer/devcontainer.json
{
"image": "docker.io/library/golang:1.16"
}
code
in the project with devcontainerInside of VSCode, open a folder. Then when prompted, Reopen folder in DevContainer.
The errors listed below should be what appear. The subsequent times I tried opening this, I could not get the logs to show. Probably has soemthing to do with a cached image, or volume.
There does seem to be this related project that does provide some tools.
I think it does need a readme as to what the project is attempting to do and provide. That way others can know how to use it immediately.
Could this be something then with the allowed ports, or something blocking VSCode from connecting to the container on the host?
The Flatpak permissions for a default install.
➜ ~ flatpak info com.visualstudio.code
Visual Studio Code - Visual Studio Code. Code editing. Redefined.
ID: com.visualstudio.code
Ref: app/com.visualstudio.code/x86_64/stable
Arch: x86_64
Branch: stable
Version: 1.57.1-1623936438
License: LicenseRef-proprietary=https://code.visualstudio.com/license
Origin: flathub-user
Collection: org.flathub.Stable
Installation: user
Installed: 2.3 MB
Runtime: org.freedesktop.Sdk/x86_64/20.08
Sdk: org.freedesktop.Sdk/x86_64/20.08
Commit: 66f03a7af14b49e5cc1dfb6daccb7cd67131404e273ae9d9ba61a91940483d14
Parent: 65657b3d372b861e5e2bec202769287e44f7be6f405a0984109666e5e3a34189
Subject: add support for mimetype x-scheme-handler/vscode (520cb933)
Date: 2021-07-19 05:00:57 +0000
➜ ~ flatpak info --show-permissions com.visualstudio.code
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;ssh-auth;
devices=all;
features=devel;
filesystems=xdg-config/kdeglobals:ro;host;
[Session Bus Policy]
org.freedesktop.Flatpak=talk
org.freedesktop.Notifications=talk
com.canonical.AppMenu.Registrar=talk
com.canonical.AppMenu.Registrar.*=talk
org.freedesktop.secrets=talk
[System Bus Policy]
org.freedesktop.login1=talk
[Environment]
LD_LIBRARY_PATH=/app/lib
NPM_CONFIG_GLOBALCONFIG=/app/etc/npmrc
I also tried allowing --filesystem=/tmp
to no avail.
Originally suggested here:
Could this be solved by creating something like org.freedesktop.Sdk.Extension.docker
?
docker
and docker-compose
executable in the sdk bin directory and to the pathdocker.sock
from the parent system to interact with the docker from thereCould this be solved by creating something like
org.freedesktop.Sdk.Extension.docker
?* that would add the `docker` and `docker-compose` executable in the sdk bin directory and to the path * that would use the `docker.sock` from the parent system to interact with the docker from there
I think looking at something like podman-desktop Flatpak should help inform a decision on how to do this. Some how they are able to use Podman via a User Socket to access containers and such from within Flatpak.
This bug still occurs. I unable to use docker from VSCode!
Version: 1.74.1
Commit: 1ad8d514439d5077d2b0b7ee64d2ce82a9308e5a
Date: 2022-12-14T10:35:03.979Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-56-generic
Sandboxed: No
flatpak info --show-permissions com.visualstudio.code
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;ssh-auth;
devices=all;
features=devel;
filesystems=xdg-config/gtk-3.0;/home/laptop/.themes;xdg-config/kdeglobals:ro;/run/docker.sock;host;/usr/share/themes;
[Session Bus Policy] org.freedesktop.Flatpak=talk org.freedesktop.Notifications=talk com.canonical.AppMenu.Registrar=talk com.canonical.AppMenu.Registrar.*=talk org.freedesktop.secrets=talk
[System Bus Policy] org.freedesktop.login1=talk
[Environment] GTK_THEME=Mint-Y-Dark-Aqua LD_LIBRARY_PATH=/app/lib NPM_CONFIG_GLOBALCONFIG=/app/etc/npmrc ZYPAK_SPAWN_LATEST_ON_REEXEC=0 QT_STYLE_OVERRIDE=Adwaita-dark
Got this working! Here are the steps:
First step is to get docker.sock
inside the flatpak with this on the host:
flatpak override --user --filesystem=/run/docker.sock com.visualstudio.code
Next in VS Code Studio, open Preferences: Open User Settings (JSON)
and make sure you have the following setting in your settings:
{
"docker.dockerPath": "/run/host/usr/bin/docker"
}
After doing these two things (assuming docker ps
works for you on your host), you should be able to refresh the containers and images list in the docker extension and use it normally within the VS Code Flatpak.
~NOTE: docker
won't be found inside the VS Code Terminal
unless you alias docker=/run/host/usr/bin/docker
, if someone knows a way to get that to stick within a flatpak, please comment.~
UPDATE: seems the best way to do this is to accomplish this is to override the default shell with one that spawns via host-spawn. Save host-spawn to your home directory, rename it to remove the arch suffix, chmod +x
to it. Then add this block to the User settings.json underneath the dockerPath
config:
"terminal.integrated.profiles.linux": {
"bash": {
"path": "${userHome}/host-spawn",
"args": ["/bin/bash"],
"overrideName": true
}
}
Great, It works indeed. At last! after months. Thank you @deftdawg
I think looking at something like podman-desktop Flatpak should help inform a decision on how to do this. Some how they are able to use Podman via a User Socket to access containers and such from within Flatpak.
Looking at podman-desktop sources, I can see that it uses flatpak-spawn --host podman
to interact with host system Podman.
A similar approach is used by project toolbox-vscode: it has (more specific: it generates) its own wrapper script to flatpak-spawn --host podman
and passes it to Dev Container extension setting dev.containers.dockerPath
. A more simple example of podman wrapper script is provided by distrobox documentation:
#!/bin/bash
set -x
if [ "$1" == "exec" ]; then
# Remove 'exec' from $@
shift
script='
result_command="podman exec"
for i in $(printenv | grep "=" | grep -Ev " |\"" |
grep -Ev "^(HOST|HOSTNAME|HOME|PATH|SHELL|USER|_)"); do
result_command=$result_command --env="$i"
done
exec ${result_command} "$@"
'
exec flatpak-spawn --host sh -c "$script" - "$@"
else
exec flatpak-spawn --host podman "$@"
fi
[UPDATE] After some testing, I've found that the flatpak-spawn --host podman
approach works well for attaching to a running container (like one started by Toolbx or Distrobox), but not for devcontainers created by VSCode (if your project has a devcontainer.json file, for example). For these cases, the podman-remote approach seems to be the only one that works.
[UPDATE 2] There was a missing piece to make flatpak-spawn --host podman
approach work with devcontainers. I need to run
flatpak override --filesystem=/tmp com.visualstudio.code
Now my setup works for both building devcontainers and attaching to running Toolbx/Distrobox containers.
Got this working! Here are the steps:
- First step is to get
docker.sock
inside the flatpak with this on the host:flatpak override --user --filesystem=/run/docker.sock com.visualstudio.code
- Next in VS Code Studio, open
Preferences: Open User Settings (JSON)
and make sure you have the following setting in your settings:{ "docker.dockerPath": "/run/host/usr/bin/docker" }
After doing these two things (assuming
docker ps
works for you on your host), you should be able to refresh the containers and images list in the docker extension and use it normally within the VS Code Flatpak.~NOTE:
docker
won't be found inside the VS CodeTerminal
unless youalias docker=/run/host/usr/bin/docker
, if someone knows a way to get that to stick within a flatpak, please comment.~UPDATE: seems the best way to do this is to accomplish this is to override the default shell with one that spawns via host-spawn. Save host-spawn to your home directory, rename it to remove the arch suffix,
chmod +x
to it. Then add this block to the User settings.json underneath thedockerPath
config:"terminal.integrated.profiles.linux": { "bash": { "path": "${userHome}/host-spawn", "args": ["/bin/bash"], "overrideName": true } }
{
"terminal.integrated.profiles.linux": {
"host-zsh": {
"path": "/usr/bin/flatpak-spawn",
"args": [
"--env=TERM=xterm-256color",
"--host",
"zsh"
]
}
},
// ...
"docker.dockerPath": "/run/host/usr/bin/docker",
"dev.containers.dockerComposePath": "/run/host/usr/bin/docker-compose",
"dev.containers.dockerPath": "/run/host/usr/bin/docker"
}
I was able to see my docker containers and attach the shell from within Flatpak VSCode, but I wasn't able to "attach Visual Studio Code".
"dev.containers.dockerComposePath": "/run/host/usr/bin/docker-compose",
"dev.containers.dockerPath": "/run/host/usr/bin/docker"
Adding the above lines inside settings.json
are now allowing me to attach the whole VSCode instance to the container.
@lbssousa
Now my setup works for both building devcontainers and attaching to running Toolbx/Distrobox containers.
Is this setup still working for you? I am on OpenSuse Aeon, I have tried everything but nothing seems to work. It is very frustrating...
The previous solutions are not working rn, on NixOS. We do need an official solution to this issue.
Not working for me, using docker desktop on Fedora 39. I think it may be related to using Docker Desktop and it's specific context.
When I open the project in Remote Container, I got a generic error. Log is inaccessibile. This is from the terminal:
[2086 ms] Dev Containers 0.321.0 in VS Code 1.84.1 (2b35e1e6d88f1ce073683991d1eff5284a32690f).
[2086 ms] Start: Run: /run/host/usr/bin/docker version --format {{.Server.APIVersion}}
[2107 ms] 1.43
[2275 ms] Start: Run: /app/extra/vscode/code --ms-enable-electron-run-as-node /home/gremo/.var/app/com.visualstudio.code/data/vscode/extensions/ms-vscode-remote.remote-containers-0.321.0/dist/spec-node/devContainersSpecCLI.js read-configuration --docker-path /run/host/usr/bin/docker --docker-compose-path /run/host/usr/bin/docker-compose --workspace-folder /home/gremo/Progetti/test-project --log-level debug --log-format json --config /home/gremo/Progetti/test-project/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root
[2410 ms] @devcontainers/cli 0.52.1. Node.js v18.15.0. linux 6.5.11-300.fc39.x86_64 x64.
[2410 ms] Start: Run: /run/host/usr/bin/docker ps -q -a --filter label=devcontainer.local_folder=/home/gremo/Progetti/test-project --filter label=devcontainer.config_file=/home/gremo/Progetti/test-project/.devcontainer/devcontainer.json
[2425 ms] Start: Run: /run/host/usr/bin/docker inspect --type container a1a2d9c86e4c
[2571 ms] Start: Run: /run/host/usr/bin/docker-compose version --short
[2576 ms] Start: Run: /run/host/usr/bin/docker compose version --short
VScode relevant settings:
"dev.containers.dockerComposePath": "/run/host/usr/bin/docker-compose",
"dev.containers.dockerPath": "/run/host/usr/bin/docker",
Docker context:
default moby Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * moby Docker Desktop unix:///home/gremo/.docker/desktop/docker.sock
After some research I've found that my local docker commands works in a different way from the flatpak version one, I mean inside VSCode terminal.
Local:
gremo@desktop-fedora ~ /usr/bin/docker compose version
Docker Compose version v2.23.0-desktop.1
VSCode terminal:
sh-5.1$ /run/host/usr/bin/docker compose version
docker: 'compose' is not a docker command.
See 'docker --help'
Since Docker now has the new syntax docker compose
(and not the old one docker-compose
), the Dev Containers extension wont' work. If you start a project in a Dev Container, you'll see:
[1825 ms] Start: Run: docker-compose version --short
[1830 ms] Start: Run: /run/host/usr/bin/docker compose version --short
The second line would of course fail.
Maybe there is some other folder to share/expose to Flatpak version, in order to make docker compose
work.
@FilBot3 After last update of VSCode (flatpak) your solution is not works, for me, anymore. VSCode all the time shows
bash: podman-remote: command not found
the com.visualstudio.code (latest) and com.visualstudio.code.tool.podman (22.08) are installed.
Create path, which VSCode mount as default (for me node_modules/bin
wasn't exist, then we create it):
mkdir -p /home/${USER}/.var/app/com.visualstudio.code/data/node_modules/bin/
Create script at /home/${USER}/.var/app/com.visualstudio.code/data/node_modules/bin/podman
:
#!/bin/sh
flatpak-spawn --host podman "$@"
Make it executable:
chmod +x /home/${USER}/.var/app/com.visualstudio.code/data/node_modules/bin/podman
Open VSCode settings and set dev.containers.dockerPath
to podman
@FilBot3 After last update of VSCode (flatpak) your solution is not works, for me, anymore. VSCode all the time shows
bash: podman-remote: command not found
the com.visualstudio.code (latest) and com.visualstudio.code.tool.podman (22.08) are installed.
This should be resolved when flathub/com.visualstudio.code.tool.podman#46 is merged.
@FilBot3 After last update of VSCode (flatpak) your solution is not works, for me, anymore. VSCode all the time shows
bash: podman-remote: command not found
the com.visualstudio.code (latest) and com.visualstudio.code.tool.podman (22.08) are installed.
This should be resolved when flathub/com.visualstudio.code.tool.podman#46 is merged.
Having the same issue after the latest update. Looking at how to downgrade vscode to get it back to working for now.
Is there an easy way to fix please, like with Flatseal? There are so many comments here I'm not sure which to follow. I just want the dev containers extension to work.
I found a solution. Instead of having to use flatpak, you can run the following command to install a proper version of Visual Studio Code on a new machine all in the terminal without needing to use flatpak, like this:
curl -L -o vscode.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" &&
sudo dpkg -i vscode.deb &&
rm vscode.deb;
FYI, If someone runs into this after updating the VSCode flatpak, makes sure to update the podman extension to the 23.08 branch as well :
flatpak remove com.visualstudio.code.tool.podman
flatpak install com.visualstudio.code.tool.podman
This setup now works again for me :)
I was able to see my docker containers and attach the shell from within Flatpak VSCode, but I wasn't able to "attach Visual Studio Code".
"dev.containers.dockerComposePath": "/run/host/usr/bin/docker-compose", "dev.containers.dockerPath": "/run/host/usr/bin/docker"
Adding the above lines inside
settings.json
are now allowing me to attach the whole VSCode instance to the container.
This worked for me as well.
FWIW on a Fedora host the docker.sock
file is in a different location. I got this to work by running:
flatpak override --user --filesystem=/run/user/1000/docker.sock com.visualstudio.code
And updating the dev.containers.dockerComposePath
and dev.containers.dockerPath
settings as above.
In VSCode settings.json the tilda (~) is not recognized, had to enter the full path to the docker/podman wrapper script -- otherwise it logs that it cannot spawn...
Still it fails while trying to clone in volume...
[69 ms] Dev Containers 0.362.0 in VS Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685).
[68 ms] Start: Resolving Remote
[80 ms] Start: Check Docker is running
[81 ms] Start: Run: /var/home/adrianherscu/flatpak-podman version
[121 ms] Client: Podman Engine
Version: 5.0.3
API Version: 5.0.3
Go Version: go1.22.2
Built: Fri May 10 03:00:00 2024
OS/Arch: linux/amd64
[128 ms] Start: Run: /var/home/adrianherscu/flatpak-podman volume ls -q
[169 ms] Start: Run: /var/home/adrianherscu/flatpak-podman volume create --label vsch.local.repository=https://github.com/QA-Automation-Starter/basic-project.git/tree/main --label vsch.local.repository.unique=true --label vsch.local.repository.branch=main basic-project-main-c941e00e7797a402f987ab45c71885e3fa7b75f0cf84692f196746890cc2ebc7
[238 ms] Start: Run: /var/home/adrianherscu/flatpak-podman build -f /tmp/vsch-adrianherscu/bootstrap-image/0.362.0/bootstrap.Dockerfile -t vsc-volume-bootstrap /tmp/vsch-adrianherscu/bootstrap-image/0.362.0
Error: context must be a directory: "/tmp/vsch-adrianherscu/bootstrap-image/0.362.0"
[280 ms] Command failed: /var/home/adrianherscu/flatpak-podman build -f /tmp/vsch-adrianherscu/bootstrap-image/0.362.0/bootstrap.Dockerfile -t vsc-volume-bootstrap /tmp/vsch-adrianherscu/bootstrap-image/0.362.0
[280 ms] Exit code 125
Any suggestion?
Added /tmp
to filesystems and solved previous issue...
Now there is another one:
[1144 ms] Command failed: docker volume ls -q
[1145 ms] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/volumes": dial unix /var/run/docker.sock: connect: permission denied
sudo chown $USER /var/run/docker.sock
didn't help :(
So, in total it is 2024 and still not working. This is the reason I am not using the vscode flatpak...
Using VSCode Flatpak to launch Podman-Remote containers for DevContainers
Overview
References
* [GitHub: flathub/com.visualstudio.code - Issue 55](https://github.com/flathub/com.visualstudio.code/issues/55#issuecomment-831234375) * [GitHub: containers/podman - podman-remote client Tutorial](https://github.com/containers/podman/blob/main/docs/tutorials/remote_client.md) * [GitHub: containers/podman - podman-remote-1.md](https://github.com/containers/podman/blob/main/docs/source/markdown/podman-remote.1.md) * [VSCode - Developing in a Container](https://code.visualstudio.com/docs/remote/containers)
Setup
Install Visual Studio Code
Install Visual Studio Code and a Podman tool
➜ ~ flatpak search com.visualstudio.code Name Description Application ID Version Branch Remotes Visual Studio Code Visual Studio Code. Code editing. Redefined. com.visualstudio.code 1.57.1-1623936438 stable flathub-root,flathub Visual Studio Code (Insiders) Visual Studio Code. Code editing. Redefined. com.visualstudio.code.insiders 1.61.0-1630915382 beta flathub-beta Code - OSS Visual Studio Code. Code editing. Redefined. com.visualstudio.code-oss 1.47.2 beta flathub-beta Podman A tool for managing OCI containers and pods com.visualstudio.code.tool.podman 3.3.1 20.08 flathub-root,flathub fish The user-friendly command line shell com.visualstudio.code.tool.fish 3.3.1 20.08 flathub-root,flathub Code - OSS Visual Studio Code. Code editing. Redefined. com.visualstudio.code-oss 1.60.0 stable flathub-root,flathub ➜ ~ flatpak --user install flathub com.visualstudio.code com.visualstudio.code.tool.podman
Override Flatpak to allow Podman Socket
See the GitHub issue for vscode flatpak issue 55.
flatpak override --user --filesystem=xdg-run/podman com.visualstudio.code
Enable Podman Socket for the User
systemctl --user enable --now podman.socket
Setup Visual Studio Code to use Podman-Remote
Install the following plugins.
flatpak run --command=bash com.visualstudio.code code --install-extension ms-vscode-remote.vscode-remote-extensionpack
This installs the
Remote Development
VSCode Plugin pack to enable Container development. Now, pressCTRL+SHIF+P
and open Settings (UI). Search fordocker
and replace the docker executable word withpodman-remote
.Test if podman-remote works
This was a little confusing at first, for some reason, I thought it would just use
podman
but it providespodman-remote
.1. Open Visual Studio Code (Flatpak). 2. Press `CTRL+(backtick)` to launch terminal. 3. Type the following
podman-remote container ls
This should show the list of Container Images, if any.
Create the DevContainer enabled project
.devcontainer/devcontainer.json
{ "image": "docker.io/library/golang:1.16" }
Launch
code
in the project with devcontainerInside of VSCode, open a folder. Then when prompted, Reopen folder in DevContainer.
The errors listed below should be what appear. The subsequent times I tried opening this, I could not get the logs to show. Probably has soemthing to do with a cached image, or volume.
Doesn't help the docker people, but I've been trying to get this to work for the past couple days with podman and enabling the podman socket I think did it with the other tips from @archekb and @lbssousa (specifically the symlinking the host-spawn binary to podman and then changing the docker path in vscode to "podman" from : https://discussion.fedoraproject.org/t/vscode-devcontainers/45874/12). Also for auxiliary permissions, if others need a summary, I let the flatpak have access to /tmp and also ran flatpak override --user --filesystem=xdg-run/podman com.visualstudio.code. This could be really valuable in some faq/wiki page.
Updated so I can come back to it The best solution I've found for this as of right now is to symlink your host's podman to podman in your flatpak container using this command:
mkdir -p ${HOME}/.var/app/com.visualstudio.code/data/node_modules/bin
ln -sf /app/bin/host-spawn ${HOME}/.var/app/com.visualstudio.code/data/node_modules/bin/podman
Then set your docker path to be podman
.
Also I needed to open the flatpak to the tmp directory using the command
flatpak override --user --filesystem=/tmp com.visualstudio.code
Or you can just use flatseal.
This is not my favorite setup because it's not a portable vscode config and I don't like leaving scripts around but it does work with seemingly 100% functionality. Please reach out if you find a better way.
Hoping for a better solution down the line.
The best solution I've found for this as of right now is to put a script into your home directory that launches podman on the host. I have this one at `~/.local/bin/podman-host'
You don't even need a wrapper script for it. Since VSCode Flatpak ships host-spawn, you can now do this:
mkdir -p ${HOME}/.var/app/com.visualstudio.code/data/node_modules/bin
ln -sf /app/bin/host-spawn ${HOME}/.var/app/com.visualstudio.code/data/node_modules/bin/podman
And keep the docker path the same?
And keep the docker path the same?
Just podman
, since ${HOME}/.var/app/com.visualstudio.code/data/node_modules/bin
is already in Flatpak's PATH
.
I've tried to use the docker extension but I got the following error:
Usually this error is fixed by adding the user to the docker group. However this fix does not seem to work in the flatpak version of vscode.