containers / containers/podman-py

Add tcp-ns option for pasta network driver

Open
#438 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
381
Forks
140
Avg merge
5h 30m
Merged PRs (30d)
1

Description

Hi, I tried all combinations I could think of but could not figure out how to create a TCP namespace forwarding of a host port to the container. Specifically I want to add 3128 from the host to the container and with the following lines in `containers.conf` I got it working just fine:

```toml
[network]
pasta_options = ["-T", "3128:3128"]
```

However, I don't want to add this to all containers, so I tried things with podman-py to no success! The closest suggestion is available at https://github.com/containers/podman-py/issues/248#issuecomment-1463728689 however my attempts resulting in some permission errors which I did not debug further (since using `containers.conf` just worked).

```python
instance = podman_client.containers.create(
...
networks={"pasta": {}},
network_options={"pasta": ["tcp-ns=3128:3128"]},
...
)
```

More Ideas were things like `network_options={"pasta": ["T=3128:3128"]}` or even `network_options={"pasta": ["T", "3128:3128"]}`.

What is the right way?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.