码头工人:gitlab + traefik&端口22 [英] docker: gitlab + traefik & port 22
问题描述
我需要在Traefik的后面设置Gitlb.
I need to set up Gitlb behind Traefik.
除了通过命令行对应用程序进行身份验证外,其他所有操作都有效-我不知道如何通过traefik公开端口22.
Everything works except authentication to the app via command line - I don't know how to expose port 22 via traefik.
任何想法如何进行设置?如何通过traefik暴露docker容器的端口22?
Any idea how to set it up? How to expose port 22 of a docker container (via traefik)?
我将默认端口从22更改为10022.
I changed the default port from 22 to 10022.
我正在通过 netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1132/sshd
tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN 1126/systemd-resolv
tcp6 0 0 :::22 :::* LISTEN 1132/sshd
tcp6 0 0 :::443 :::* LISTEN 1590/docker-proxy
tcp6 0 0 :::10022 :::* LISTEN 1440/docker-proxy
tcp6 0 0 :::5355 :::* LISTEN 1126/systemd-resolv
tcp6 0 0 :::80 :::* LISTEN 1602/docker-proxy
tcp6 0 0 :::8080 :::* LISTEN 1578/docker-proxy
udp 0 0 127.0.0.53:53 0.0.0.0:* 1126/systemd-resolv
udp 0 0 0.0.0.0:68 0.0.0.0:* 864/dhclient
udp 0 0 0.0.0.0:5355 0.0.0.0:* 1126/systemd-resolv
udp6 0 0 :::5355 :::* 1126/systemd-resolv
我不明白为什么10022连接到docker-proxy.
I don't understand why 10022 is connected to docker-proxy.
当我尝试时:
git push --set-upstream origin master
ssh: connect to host git.myserver.com port 10022: Connection refused
fatal: Could not read from remote repository.
非常感谢
推荐答案
Traefik是HTTP反向代理,而ssh不是HTTP协议.因此,您只需要在主机上未使用的端口上发布容器的ssh端口即可.
Traefik is an HTTP reverse proxy, and ssh is not an HTTP protocol. So you'll need to simply publish the container's ssh port on an unused port on the host.
这篇关于码头工人:gitlab + traefik&端口22的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!