Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

app.yaml to send params to Dockerfile

I am deploying a binary on Google cloud flexible app engine for two different services. So I have {app-service1.yaml, Dockerfile-service1} and {app-service2.yaml, Dockerfile-service2}. And use "gcloud app deploy" command to deploy them.

Is it possible to send a param from app-service[1|2].yaml to a single Dockerfile, so that I can maintain only one Dockerfile?

I tried two things but they didn't work with "gcloud deploy" command:

  1. "entrypoint:" in app.yaml -- It does not override what is set in CMD in Dockerfile.
  2. "env_variables:" in app.yaml -- Dockerfile's ENV or ARG do not see any variables defined in env_variables:.
like image 695
PaulC Avatar asked Dec 06 '25 08:12

PaulC


1 Answers

There's currently no way (I can think of) to pass parameters into the docker build process while using gcloud app deploy. If the dockerfiles you're using are similar, you may want to consider creating a base docker file, building a base image, and then sending it to gcr.io. Then you can extend the base image with your other Dockerfile(s).

Hope this helps!

like image 135
Justin Beckwith Avatar answered Dec 09 '25 09:12

Justin Beckwith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!