PaulC
PaulC

Reputation: 31

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:.

Upvotes: 3

Views: 1361

Answers (1)

Justin Beckwith
Justin Beckwith

Reputation: 7866

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!

Upvotes: 1

Related Questions