如何在Google Cloud Platform上使用Docker Bridge网络? [英] how to use docker bridge network on google cloud platform?

查看:90
本文介绍了如何在Google Cloud Platform上使用Docker Bridge网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过以下方式使用hostip:8000打开网站:

I can't use the following ways to open website with hostip:8000:

docker network create -d bridge mybridge 

docker run -d --net mybridge --name db redis 
docker run -d --net mybridge -e DB=db -p 8000:5000 --name web chrch/web

我已经构建了没有docker映像的gpu VM实例,并自己安装了docker

I have build gpu VM instance without docker images and install docker by myself

如何解决这个问题?

推荐答案

这些步骤应该可以解决您的问题

These steps should solve your problem

  • 使用docker ps检查您的容器正在运行

  • Check with docker ps that your containers are running

检查GCP控制台中的防火墙.如果端口8000已打开(如果您的IP没有打开)

Check if firewall in GCP console. If port 8000 is open ( if no open for your ip )

检查GCP控制台的VM的公共IP并尝试使用

Check GCP console your VM's Public IP and try with that

这篇关于如何在Google Cloud Platform上使用Docker Bridge网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆