【发布时间】:2019-02-27 23:29:39
【问题描述】:
我有一个 Docker 容器,我希望它能够通过 SSH 隧道与数据库进行交互。
我的 Docker 镜像是基于 alpine 镜像构建的,在 Dockerfile 中我安装了 openssh-client 并公开了 27017 端口
当我启动 Docker 映像并尝试通过以下方式转发端口时:
ssh -i /.ssh/ssh_key user@remote_ip -L 27017:localhost:27017 -Nf
我收到一个错误:
bind: Address not available
ssh 到远程服务器没有问题,但我无法转发端口。
谢谢
【问题讨论】:
标签: docker ssh portforwarding openssh alpine