run private docker images on Google Container Engine

0 votes

How do I run a docker image that I built locally on Google Container Engine?

Aug 30, 2018 in Kubernetes by Hannah
• 18,520 points
877 views

2 answers to this question.

0 votes

Follow theses steps:

  1. Setup some environment variables

    gcloud components update kubectl
    gcloud config set project <your-project>
    gcloud config set compute/zone <your-cluster-zone>
    gcloud config set container/cluster <your-cluster-name>
    gcloud container clusters get-credentials <your-cluster-name>
    
  2. Tag your image

    docker tag <your-image> gcr.io/<your-project>/<your-image>
    
  3. Push your image

    gcloud docker push gcr.io/<your-project>/<your-image>
    
  4. Create a pod manifest for your container: my-pod.yaml

    id: my-pod
    kind: Pod
    apiVersion: v1
    desiredState:
      manifest:
        containers:
        - name: <container-name>
          image: gcr.io/<your-project>/<your-image>
        ...
    
  5. Schedule this pod

    kubectl create -f my-pod.yaml
    
  6. Repeat from step (4) for each pod you want to run. You can have multiple definitions in a single file using a line with --- as delimiter.

answered Aug 30, 2018 by Kalgi
• 52,350 points
0 votes

run docker login on minions before starting. 

  docker login --username=<> --password=<> --email=<> <DockerServer>
answered Aug 30, 2018 by Nilesh
• 7,060 points

Related Questions In Kubernetes

0 votes
1 answer

Accessing private Docker Hub repository from Kubernetes on Vagrant

In order to pull private dockerhub hosted ...READ MORE

answered Sep 18, 2018 in Kubernetes by DareDev
• 6,890 points
1,466 views
0 votes
2 answers
0 votes
1 answer

Kubernetes HTTPS Ingress in Google Container Engine

n order to have HTTPs service exposed ...READ MORE

answered Nov 23, 2018 in Kubernetes by DareDev
• 6,890 points
899 views
0 votes
1 answer

Unable to run Kubernetes on rancher cluster

switch Docker to 1.12.x; Kubernetes doesn't support ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,350 points
1,382 views
+2 votes
1 answer
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
3,925 views
0 votes
1 answer
0 votes
1 answer

“403 Insufficient Permission” while creating a Kubernetes Cluster on Google Cloud instance

To run ./cluster/kube-up.sh, you most likely need compute scope ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,350 points
1,309 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP