Comments (9)
Upon inspecting the code, this appears to be happening because the only part of the port mapping that gets read is the protocol, not the host/container port, ip address, etc. I would say that would be the root issue, but on a local unix socket connection I don't have the same issue.
For example, on a container that was created with --publish 5173:80
:
Some(
PortMapping {
container_port: None,
host_ip: None,
host_port: None,
protocol: Some(
"tcp",
),
range: None,
},
)
from pods.
Thanks for reporting.
Reading the documentation, it seems that Podman uses a random port if the field host_port
is being omitted.
HostPort is the port number that will be forwarded from the host into the container. If omitted, a random port on the host (guaranteed to be over 1024) will be assigned.
But in this case, it shouldn't do this because of --publish 5173:80
.
but on a local unix socket connection I don't have the same issue.
This is indeed weird. What version of Podman are you using?
from pods.
I'm using podman version 4.3.1
on my laptop, 3.0.1
on my server. Perhaps thats the issue?
from pods.
Yeah, probably. The version is so old it even isn't listed anymore on the API reference overview :-)
https://docs.podman.io/en/latest/Reference.html
For my understanding: You are using the unix socket for 4.3.1
and the TCP socket for 3.0.1
?
I think there wouldn't be an error if you'd expose the 4.3.1
via TCP podman instance and connect to that?
I will try to setup a VM with that particular podman version for reproduction purposes in the next days.
from pods.
Correct, that's the setup (a certified Debian moment if I say so myself)
In the meantime I'll try to see if I can use a backport of a newer podman on the server.
from pods.
What you could also try is to change the problematic line
Line 331 in b036fd2
To somethting like this
mapping.host_port.unwrap_or(80),
In this we, we can check whether more errors may follow
from pods.
It looks like everything works after that! I can view the images, containers, processes, etc all just fine.
from pods.
Ok, I've set up the debian VM. The problem is that podman 3.0 uses camelCase for the "Ports" field names
❯ curl http://bullseye:37017/v3.0.1/libpod/containers/json
[{"AutoRemove":false,"Command":["/bin/sh"],"Created":"2023-01-30T20:58:12.329067206+01:00","CreatedAt":"","Exited":false,"ExitedAt":-62135596800,"ExitCode":0,"Id":"9c6a10c729bfbbc5d9fee00e645daa4839bfca68a5a425d8cd7fdf3e9fd8c517","Image":"docker.io/library/alpine:latest","ImageID":"042a816809aac8d0f7d7cacac7965782ee2ecac3f21bcf9f24b1de1a7387b769","IsInfra":false,"Labels":null,"Mounts":[],"Names":["flagrant-record"],"Namespaces":{},"Networks":["podman"],"Pid":797,"Pod":"","PodName":"","Ports":[{"hostPort":5555,"containerPort":5555,"protocol":"tcp","hostIP":""}],"Size":null,"StartedAt":1675108693,"State":"running","Status":""}]
Since 3.1 podman uses snake_case
"Ports":[{"host_ip":"","container_port":35017,"host_port":35017,"range":1,"protocol":"tcp"}],
See the documentation
Unfortunately, the library podman-api-rs
, which Pod uses, doesn't cover this.
I can work around this specific issue by showing a "?" instead of an actual port number. But IMHO, it would be the best approach to upgrade to 3.1
since 3.0
is basically undocumented at this point.
from pods.
I decided to not show the port if it is absence. Please feel free to report all the bugs you encounter! Let's see how many of them we can actually fix.
from pods.
Related Issues (20)
- Use `Special case exclusive toggles` instead of inline view switcher HOT 1
- GNOME Circle submission HOT 1
- Filter running containers HOT 6
- Back button/swipe to go back HOT 2
- Unable to connect to unix socket HOT 2
- When you press the lightbulb icon setting up a connection during the first setup, you can't exit it. HOT 3
- [Feature] Highlight image names over hashes HOT 3
- circular_progress_bar crash HOT 4
- Keep terminal running in background HOT 1
- Can't create file at /run/systemd/journal/socket: No such device or address HOT 3
- Able to push the local image to registry
- Romanian language (RO) is missing from the built package HOT 3
- Failed to start Secret Service: Portal(CancelledPortalRequest) HOT 2
- Pods 1.2.2 fails to build from source HOT 2
- Upload to container/Download from container : select file/path does nothing HOT 6
- Ability to edit volumes/port mapping of an existing container HOT 5
- The terminal does not support '\b' well HOT 3
- Pods window stays blank after opening HOT 2
- Docker support HOT 6
- Add ability to pass options to container creation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pods.