Google Compute Engine 容器端口已关闭
Google Compute Engine Container Port Closed
我添加了一条防火墙规则来打开端口 8080。如果我在 GCE 控制台中单击 SSH 按钮,并且 运行 在主机上 shell:
nc -l -p 8080 127.0.0.1
我可以检测到打开的端口。如果我然后使用以下命令转到容器的 shell:
docker run --rm -i -t <image> /bin/sh
和运行同样的netcat命令,我检测不到开放端口
我走这条故障排除路线是因为我无法连接到 node:alpine
容器 运行 为演示 websocket 服务器连接 ws
npm。这是我的 dockerfile:
# specify the node base image with your desired version node:<version>
FROM node:alpine
# replace this with your application's default port
EXPOSE 8080
WORKDIR /app
RUN apk --update add git
docker run --rm -i -t -p 8080:8080 <image> /bin/sh
每
我添加了一条防火墙规则来打开端口 8080。如果我在 GCE 控制台中单击 SSH 按钮,并且 运行 在主机上 shell:
nc -l -p 8080 127.0.0.1
我可以检测到打开的端口。如果我然后使用以下命令转到容器的 shell:
docker run --rm -i -t <image> /bin/sh
和运行同样的netcat命令,我检测不到开放端口
我走这条故障排除路线是因为我无法连接到 node:alpine
容器 运行 为演示 websocket 服务器连接 ws
npm。这是我的 dockerfile:
# specify the node base image with your desired version node:<version>
FROM node:alpine
# replace this with your application's default port
EXPOSE 8080
WORKDIR /app
RUN apk --update add git
docker run --rm -i -t -p 8080:8080 <image> /bin/sh
每