cloudflare利用Zero Trust里的tunnels实现内网穿透
正在生成摘要,请稍候...
界面预览
cloudflare tunnels生成的docker运行程序
1 | docker run -d --restart=always cloudflare/cloudflared:latest tunnel --no-autoupdate run --token eyJhIjoiZDZiNmEzN2EwM2EzMzZlODgzYjk4NGZmMmYxMzkyMzIiLCJ0IjoiZGVkZDMyMjktMWM4NS00MDE1LWI3M2QtMjMyOTE0MTcyNmQ0IiwicyWWWWWI6IlpqZzRNbUprWWpNdFpXRXhNaTAwTm1OakxUaGxORFV0WmpnMVkyTTNOMlpoTURJMCJ9 |
naswwwww.7306923.xyz
对应http://10.168.11.133:5000 ,注意不要漏掉端口号
假如运行以上docker
运行程序报错,显示不能连接docker
仓库的话改为自己的仓库地址docker.cuiewwwww.us.kg
去拉取并运行,例如:
1 | docker run -d --restart=always docker.cuiewwwww.us.kg/cloudflare/cloudflared:latest tunnel --no-autoupdate run --token eyJhIjoiZDZiNmEzN2EwM2EzMzZlODgzYjk4NGZmMmYxMzkyMzIiLCJ0IjoiZGVkZDMyMjktMWM4NS00MDE1LWI3M2QtMjMyOTE0MTcyNmQ0IiwicyIWWWWW6IlpqZzRNbUprWWpNdFpXRXhNaTAwTm1OakxUaGxORFV0WmpnMVkyTTNOMlpoTURJMCJ9 |
注意一定要加
-d --restart=always
来让后台一直运行,或者用-d --restart=unless-stopped
也可以添加--name cloudflared
命令来让容器命名为cloudflared
1 | docker run --name cloudflared -d --restart=unless-stopped docker.cuiewwwww.us.kg/cloudflare/cloudflared:latest tunnel --no-autoupdate run --token eyJhIjoiZDZiNmEzN2EwM2EzMzZlODgzYjk4NGZmMmYxMzkyMzIiLCJ0IjoiZGVkZDMyMjktMWM4NS00MDE1LWI3M2QtMjMyOTE0MTcyNmQ0IiwicyIWWWWW6IlpqZzRNbUprWWpNdFpXRXhNaTAwTm1OakxUaGxORFV0WmpnMVkyTTNOMlpoTURJMCJ9 |
以上就是用
-d --restart=unless-stopped
来实现的后台一直运行
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 駝駱仧🐫!
评论