[ Getting Started ]
Deploying Container on GCE
[ Getting Started ] Deploying Container on GCE
Are you wondering how to manage containers and managed instance groups in your familiar IaaS environment without costing extra resources or making repetitive steps of establishment over and over again? You can work with Docker Run, Docker Compose, Kubernetes, or simply choose a simpler and easier way by dropping the container image on GCE. After following our tutorial, you will find that deploying container on GCE only takes few minutes!
- Check Container, you will find Boot Disk automatically replaced with Container-Optimized OS.
- Provide container image name: if it is not a public image, you can push it to GCS or Google Cloud Container Builder (Both require the Google Cloud SDK installed).
$ docker build -t ///: -f ./Dockerfile . #ex $ docker build -t us.gcr.io/hello-gcp/hello-gcp/myapp:0.1.13b -f ./Dockerfile .
$ gcloud docker -- push
/ / / : #ex $ gcloud docker -- push us.gcr.io/hello-gcp/hello-gcp/myapp:0.1.13b
$ gcloud container builds submit -t
/ / / : . #ex $ gcloud container builds submit -t us.gcr.io/hello-gcp/hello-gcp/myapp:0.1.13b .
- Revise in accordance with your requirements (in the red box).
- Check Run as privileged if you require -privileged, -cap-add or -cap-drop.
- Get Started!
- In the above implementation, container and Host OS Port are one-to-one mapping. It doesn’t require additional setting.
- Please set up your VPC network Firewall rules if it is public service.
- All traffic of the instance will be forwarded to Host OS over the connection with SSH.
- Docker can give commands to the container over the connection.
- “Docker logs” is not available for now so you can use “Docker attach container-id” instead.