我尝试通过 Azure Container Service 在 Docker swarm 上提供 Python Flask(端口 5000)。
部署的代理可以通过curl 0.0.0.0:5000
集群管理连接,但不能从互联网外部连接。
端口 5000 在代理 Azure 负载均衡器中定义良好。我还能检查什么?
我通过以下命令启动烧瓶。
docker run -d -p 5000:5000 bbb/web /root/startScript.sh
结果docker ps
如下。bbb/web
是我想要服务的。
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
05a96351290c bbb/web "/root/startScript.sh" 43 minutes ago Up 43 minutes 0.0.0.0:5000->5000/tcp jovial_meitner
adcc2d45cbe0 swarm:1.1.0 "/swarm manage --repl" 8 months ago Up 7 weeks 0.0.0.0:2375->2375/tcp containers_swarm_1
2264e2b1636f progrium/consul "/bin/start -server -" 8 months ago Up 7 weeks 0.0.0.0:8300-8302->8300-8302/tcp, 0.0.0.0:8400->8400/tcp, 53/tcp, 53/udp, 0.0.0.0:8500->8500/tcp, 0.0.0.0:8301-8302->8301-8302/udp containers_consul_1
结果docker network ls
如下
NETWORK ID NAME DRIVER SCOPE
66bf169bd8f9 bridge bridge local
2aeb61431acf host host local
19448e290e2c none null local
结果docker info
如下
Containers: 5
Running: 3
Paused: 0
Stopped: 2
Images: 3
Server Version: 1.12.2
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 48
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: overlay null host bridge
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor
Kernel Version: 3.19.0-65-generic
Operating System: Ubuntu 14.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 3.36 GiB
Name: swarm-master-A501B991-0
ID: KKRP:45CG:NSBD:EUP5:PDGV:S3QA:4UUJ:NUIS:YP7I:DBLM:GSXU:47SC
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: bbb
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
127.0.0.0/8