0

which GCP Compute Engine instance Data Scientist use to build Docker images and push them on GCP Container Registry ?

  1. I am not allowed to have Docker installed on my Laptop
  2. I cannot build it on CloudShell because my image is too big (>5 GB)
  3. I can do it on Debian/Unbuntu VM but I need to installed Docker (I need to reinstall SDK, to install Docker and add user)
  4. I can do it on Container-Optimized OS VM but SDK (need to push the image on CP Container Registry) need to be installed as well as python 2

Is there another easier option with everything already pre installed (Docker and SDK) ? How people do that in general ? Is there other points I should take into account for making my choice of Compute Engine instance ?

Dr. Fabien Tarrade
  • 1,556
  • 6
  • 23
  • 49
  • People spend the time to install and set up everything. Google Cloud Build is a great service for building containers, but you still need Docker or equivalent to run and test your containers. If you are also a developer, then you need even more installed and set up. Given the vast array of options, ... – John Hanley May 09 '19 at 05:35
  • Great John, I thought Google Cloud Build was building the image in my CloudShell. As you mention, I still need a place to run the container for the test. – Dr. Fabien Tarrade May 09 '19 at 09:57

1 Answers1

3

Have a look at Google Cloud Build

With it, you can build (among other things) a container image merely by providing a Dockerfile (and any source files).

The service will build your image and push it to Google Container Registry:

https://cloud.google.com/cloud-build/docs/quickstart-docker

DazWilkin
  • 32,823
  • 5
  • 47
  • 88
  • This is a great solution for building images but as it was mentioned by John, I need a place to run and test the containers. – Dr. Fabien Tarrade May 09 '19 at 10:00
  • Cloud Build is an open-ended tool. You can include build tests, linting etc. In (`cloudbuild.yaml`) scripts. Once you've built an image with Cloud Build you could simply pull it to a Container OS instance or other VM on Compute Engine (with Docker Engine) and perform arbitrary tasks there. You don't need to install Docker Engine locally. – DazWilkin May 09 '19 at 14:08
  • Thanks for these info. It is exactly what I wanted to do. I will follow your suggestions. – Dr. Fabien Tarrade May 09 '19 at 17:09
  • You could even deploy the image to a GCE instance from Cloud Build ;-) Email me (@google.com) if you encounter challenges. I'm happy to help! – DazWilkin May 09 '19 at 19:27