-
Notifications
You must be signed in to change notification settings - Fork 301
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
Container samples not working using podman #2881
Comments
With Docker we mount the Docker socket into a container to build the image from a volume. We need to investigate if something similar can be done with Podman. (Seeing containers/podman#4056 and containers/podman#4131 discussions.) |
/cc @egamma |
I created this issue in libpod. It's technically possible to control podman from container through ssh varlink but there is a new api server. I'd say we can wait until podman api is complete, then vscode sample container can have podman inside access it through unix socket or tcp socket. |
Do we need to go through an API server? My understanding of Podman is that it works without a server, so the API server shouldn't add anything beyond giving access to the local libpod. Maybe we can access that from the container directly if we give the container the required privileges. The reason we need this is that we want to build a Docker image from the sources we clone into a Docker volume. The container for doing this is temporary. |
API is just a way to get out of podman container to do what the current docker solution in vscode is basically doing, it's not actually a container in container. This is already supported by varlink or api(in the future) in podman. If building container in container is the only requirement, that's also supported but you have to use buildah with chroot isolation mode with vfs inside podman. |
I wonder if there has been any decision made on this topic. |
Podman in Podman appears to work now: containers/podman#4056 (comment) |
I'm unable to get the sample containers to run using podman, it's failing at the same step, but producing a slightly different error. repro
I've also tried it with the I'm willing to make a new bug ticket since my problem seems slightly different and this issue is rather broad. |
@chrmarti Sure, using docker socket is not a good idea. Podman is CLI 1st and doesn't need any server, any client, and any Network security if used locally in one computer or private network! Everything could be done using ssh command or wsl command. Dockerod is redundant too because the object model can be generated from the published API spec. and its connectivity layer is redundant (see above). |
I seem to be able to fix the above error using There is a slight workaround for the issue, where if you remove the |
According to @chrmarti , docker socket is mounted in order to build an image alone. With buildah chroot mode, no socket is required. You can just build and export it as tgz and load it from the host container engine. |
Buildah is CLI - it doesn't need any socket. or server. The problem with Podman and Buildah that each one has its own Filesystem tree. The image built by Buildah has to be pushed to somewhere or buildah from is executed to create container in the Podman container storage. Then run by Podman. It made me a headache. Skopeo moves images between repositories and inspects images without a pull. Everything worked for me fine only if there is a V2 OCI container registry in between (their friend JFrog). |
You can export it as tgz or tar so that you can load from any container engine. |
Exporting and importing a tgz will add to the startup time. Can we instead mount Podman's local image folder and just build the image for that directly?
To clarify: Docker's socket is mounted into a temporary container controlled by the extension, this container is not the sample container. |
Using sockets for Buildah and Podman is meaningless. Both are CLI development tools. Podman socket is used only to use Podman remotely. The real "remote Podman" is Kubernetes. Kubernetes and Docker have divorced. Buildah can run on the "bare" Linux OS or Linux VM. The alternative is Running Buildah in container. |
You might be able to bind mount the whole docker/podman image directory, but then it's no different from mounting docker socket for no good reason(the current solution). The current solution might be good enough for environment where docker is running on different filesystem like docker-for-mac, but not for native linux. I suggest reading the link that @PavelSosin-320 provided. @chrmarti . |
@matt-froggatt Do you suggest to run Podman as the Docker engine using systemctl enable --now podman.socket ? It will revert all Podman benefits back to the Docker limitations: The Podman socket will restrict access to the Podman to only Rootfull users (root, wheel ) or users that belong to the Docker group. The Podman listener service has to be started during "boot" or externally. Instead of plain Linux security users will have to deal with Proxies, Network security, Ports forwarding over the network. Special efforts will be required to handle unique Docker repository protocol instead of free choice of repository transport. |
@matt-froggatt Could you expand on this work around? |
@chrmarti sorry to ping you on this, but according to this discussion it looks like the temporary container should be launched with either |
There is no way to control this currently. We should probably detect that we are using Podman and then add one of these flags. Thanks! |
In my case, I want to use the Alpine image provided by vscode the error with
The leftover bug is
which can be solved with
as last statement in the Dockefile After this the container could started but the modifications in files could not be saved because of permission denied errors :( |
|
Any progress on this? |
I opened new issue. see containers/podman#21548 |
Refs #2854
repro
Containers: Try a sample
and selectPython
Bug
The container fails to start.
Logs:
And the specific error:
The text was updated successfully, but these errors were encountered: