Google Container Registry push image

docker

#1

How to do correct pushing build image to Google?


#2

Looks like you need gcloud cli

https://cloud.google.com/container-registry/docs/pushing-and-pulling


#3

How to add gcloud to my circle.yml?

https://circleci.com/gh/dmapper/idg/435

Right now my circle.yml is here.


#4

You need to first install it like you would anything else.

As an aside, it looks like you’re pulling in the docker image and reinstalling Docker. That shouldn’t be necessary.


#5

Could provide example please?


#6

Remove lines 20-27


#7

Done. What next? How to install gcloud and provide details?


#8

https://cloud.google.com/sdk/docs/


#9

gcloud auth activate-service-account --key-file

How to provide json file to circleci?


#10

Their documentation says to commit it to your repo.

A safer solution is to store the creds as env vars and build the json file yourself.

Up to you.


#11

apt-get install -y python2.7
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-153.0.0-linux-x86_64.tar.gz
tar -xzf google-cloud-sdk-153.0.0-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh --usage-reporting false --command-completion true --additional-components alpha beta --quiet

/bin/sh: apt-get: not found
Exited with code 127


#12

Which base image are you using?


#13

https://circleci.com/gh/dmapper/idg/449


#14

What image need to use in circle.yml?

need apt working… to install google sdk


#15

It’s an Alpine image you’re using- you need apk


#16

How to use apk?


#17

I’m going to need you to Google that.


#18

find, thx :slight_smile:

Is there an image that contains the familiar apt-get?


#19

Any Debian/Ubuntu one. All our images are Debian Jessie based.

https://circleci.com/docs/2.0/circleci-images/


#20
version: 2
jobs:
  build:
    docker:
      - image: docker:1.13.1-git
      - image: circleci/python:latest

So, I must in build add for example python and in run section command apt-get will be available?

 - run: |
      apt-get install -y python2