I need to setup a ssh server (actually a git repo) inside a podman container.
The host system has sshd
already running on port 22
.
I am creating a pod
with following command:
# podman pod create --name=gitlab --share net -p 22:22 -p 443:443 -p 80:80
# podman create --name=gitlab_gitlab_1 [...]
And when I try to run it, I get following expected error:
# podman create --name=gitlab_gitlab_1
ERRO[0000] "cannot listen on the TCP port: listen tcp4 :22: bind: address already in use"
This is expected, as the 22
port is, in fact, in use.
So I have added a secondary IP address to the host system for the sole purpose of binding it to the container (pod?).
The hosts sshd is NOT listening on the secondary IP.
How can "tell" podman to use the secondary IP address for the port forwarding to this (or all of) pod.