Google Cloud PlatformでのWebページの公開について質問させてください。
行った手順:
Dockerホスト作成
$ docker-machine create --driver google --google-project プロジェクトID --google-zone us-central1-a vm01
Dockerホスト上でコンテナ起動
$ eval $(docker-machine env vm01) $ docker run -d -p 8000:80 --name webserver kitematic/hello-world-nginx Unable to find image 'kitematic/hello-world-nginx:latest' locally latest: Pulling from kitematic/hello-world-nginx Image docker.io/kitematic/hello-world-nginx:latest uses outdated schema1 manifest format. Please upgrade to a schema2 image for better future compatibility. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/ 77c6c00e8b61: Pull complete 9b55a9cb10b3: Pull complete e6cdd97ba74d: Pull complete 7fecf1e9de6b: Pull complete 6b75f22d7bea: Pull complete e8e00fb8479f: Pull complete 69fad424364c: Pull complete b3ba6e76b671: Pull complete a956773dd508: Pull complete 26d2b0603932: Pull complete 3cdbb221209e: Pull complete a3ed95caeb02: Pull complete Digest: sha256:ec0ca6dcb034916784c988b4f2432716e2e92b995ac606e080c7a54b52b87066 Status: Downloaded newer image for kitematic/hello-world-nginx:latest
Google Cloud上のファイアウォールの8000番ポートを開放
ターゲットタグ = ルール名と同じ
ソース IP の範囲 = 0.0.0.0/0
プロトコルとポート = tcp:8000
ホストのIPアドレスを取得
$ docker-machine ip vm01 11.111.111.111
ブラウザにIPアドレスと解放したポート番号を入力
11.111.111.111:8000
=> エラー
気になったのが以下の結果で、URLの最後が8000になるべきなのかな、と思っています。
$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS vm01 * google Running tcp://11.111.111.111:2376 v19.03.5
11.111.111.111:2376ではアクセスでき、
Client sent an HTTP request to an HTTPS server.
と表示されます。
しかしwebserverコンテナとGCPで指定した8000番(11.111.111.111:8000)ではアクセスできません。
アクセスできるようにするには、どうしたらいいでしょうか?
あなたの回答
tips
プレビュー