Google Cloud 运行 - 如何为 GCR 指定 docker 命令行参数?
Google Cloud Run - how to specify docker command line arguments for GCR?
我有一个 Docker 容器,在 运行 内有一个带有 Gunicorn 的 Flask 服务器。
在本地,我 运行 使用 docker run -p 443:443 appcontainer
它工作得很好。
我不知道如何告诉 Google Cloud 运行 做同样的事情,是否可以为它指定 -p
或任何其他 Docker 命令行参数重要吗?
根据 Docker 文档
Published ports
By default, when you create or run a container using docker create or
docker run, it does not publish any of its ports to the outside world.
To make a port available to services outside of Docker, or to Docker
containers which are not connected to the container’s network, use the
--publish or -p flag. This creates a firewall rule which maps a container port to a port on the Docker host to the outside world
Cloud 运行(完全托管)始终通过 HTTPS 和云 运行 容器在默认端口 8080 上侦听的单个端口(在 :443 上)公开服务。据我了解默认设置类似于 (-p 443:8080
).
但是,如果您想更改默认端口,您可以配置将请求发送到容器的端口 8080
Configuring the container port
gcloud run services update SERVICE --port 443
我有一个 Docker 容器,在 运行 内有一个带有 Gunicorn 的 Flask 服务器。
在本地,我 运行 使用 docker run -p 443:443 appcontainer
它工作得很好。
我不知道如何告诉 Google Cloud 运行 做同样的事情,是否可以为它指定 -p
或任何其他 Docker 命令行参数重要吗?
根据 Docker 文档 Published ports
By default, when you create or run a container using docker create or docker run, it does not publish any of its ports to the outside world. To make a port available to services outside of Docker, or to Docker containers which are not connected to the container’s network, use the --publish or -p flag. This creates a firewall rule which maps a container port to a port on the Docker host to the outside world
Cloud 运行(完全托管)始终通过 HTTPS -p 443:8080
).
但是,如果您想更改默认端口,您可以配置将请求发送到容器的端口 8080
Configuring the container port
gcloud run services update SERVICE --port 443