0

I have built a docker image that when run, it registers itself as a GitHub Runner. This runner will, amongst other things, be used to build and push images to GitHub Container Registry. I don't want to deploy the containers to GKE or Compute, as I don't want the overhead of managing those resources. I would prefer to deploy the containers to Google Cloud Run. I've scoured the docs for help but I can't seem to find the answers to the following question:

  1. Can I run 'docker in docker' when the container is deployed to GCP Cloud Run?

  2. How do I specify the volume mount required when deploying the container to Google Cloud Run, i.e. the usual mapping with docker run would be:

    -v /var/run/docker.sock:/var/run/docker.sock

Molenpad
  • 833
  • 2
  • 14
  • 34
  • Docker-in-docker is not allowed on cloud run. However, you can use it on [cloud build](https://stackoverflow.com/questions/59067799/with-google-cloud-build-how-do-i-run-a-makefile-that-executes-docker-and-kubect) but this is not a recommended practice. – vi calderon Mar 25 '21 at 16:48

1 Answers1

1
  1. I never tested but it's possible that the current Cloud Run sandbox prevent this king of use. And I don't really know the use case for this!
  2. You can't mount volume in Cloud Run, it's stateless. You only have a in-memory file system in the /tmp directory (and it's in memory, size correctly your Cloud Run instance memory to take this into account). You can connect your instance to 3rd party product, such as Google Cloud Storage or databases, but no volume mountable on Cloud Run (for now)

If you have these requirement you can maybe have a look to autopilot and deploy directly your container on fully managed K8S.

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • 2
    fwiw I maintain [helm charts for deploying a self hosted GitHub actions-runner](https://github.com/lazybit-ch/actions-runner) with an optional [docker in docker](https://github.com/lazybit-ch/dind) deployment in Kubernetes. – masseyb Mar 13 '21 at 04:00