Sign inSign up

mangothecat/docker-docker-gcpsdk

By mangothecat

Updated over 7 years ago

Docker-in-Docker with GCP SDK

Image
0

4.1K

mangothecat/docker-docker-gcpsdk repository overview

Docker with Google Cloud SDK

This docker image install gcloud and kubectrl on top of the docker image. This is used in our CI Pipeline for Google Kubernetes Engine.

Versions

By default this will use latest version of Docker and Google SDK

Usage

To use this package in your CI, try adding this to your .gitlab-ci.yml file:

build_docker_image:
    image: adamdeacon/docker-gke
    tags:
        - el7
    stage: build
    only:
        - master
        - tags
    script:
        - docker info
        - export PATH=$PATH:/root/google-cloud-sdk/bin
        - gcloud config set project $PROJECT_ID
        - echo $K8S_SECRET_SERVICE_ACCOUNT > /tmp/$CI_PIPELINE_ID.json
        - gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json
        - gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://gcr.io
        - docker build -t gcr.io/${PROJECT_ID}/${APPNAME}:v${VERSION} .
        - docker push gcr.io/${PROJECT_ID}/${APPNAME}:v${VERSION}

Author

Adam Deacon for Mango Solutions

Thanks to Tobias L. Maier

Tag summary

Content type

Image

Digest

Size

261.2 MB

Last updated

over 7 years ago

docker pull mangothecat/docker-docker-gcpsdk