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
• 16,220 points
35 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
• 41,990 points
0 votes

run docker login on minions before starting. 

  docker login --username=<> --password=<> --email=<> <DockerServer>
answered Aug 30, 2018 by Nilesh
• 6,880 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,810 points
212 views
0 votes
1 answer

Can I run docker containers on different machines?

Yes, but you should also: create the relevant libnetworks in ...READ MORE

answered Oct 17, 2018 in Kubernetes by lina
• 8,110 points
44 views
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,810 points
60 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
• 41,990 points
172 views
0 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
1,032 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
• 41,990 points
171 views