5

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.

3
  • Hi @SWilk, did you manage to get podman to bind to the IP/interface? Looking through the documentation I don't think this is possible but maybe you found another solution to your problem?
    – Greg0ry
    Feb 18, 2020 at 19:58
  • 2
    @Greg0ry: I have ended hardcoding the IP into the script that executes pod creation command: # podman pod create --name=gitlab --share net -p 192.168.10.20:22:22 -p 443:443 -p 80:80
    – SWilk
    Feb 23, 2020 at 1:39
  • Thanks! That makes sense!
    – Greg0ry
    Feb 24, 2020 at 7:04

0

You must log in to answer this question.

Browse other questions tagged .