<p>I have a dockerfile that looks like this at the moment:</p>

<pre><code>FROM golang:1.8-alpine
COPY ./ /src
ENV GOOGLE_CLOUD_PROJECT = "snappy-premise-118915"
RUN apk add --no-cache git &amp;&amp; \
    apk --no-cache --update add ca-certificates &amp;&amp; \
    cd /src &amp;&amp; \
    go get -t -v cloud.google.com/go/pubsub &amp;&amp; \
    CGO_ENABLED=0 GOOS=linux go build main.go

# final stage
FROM alpine
ENV LATITUDE "-121.464"
ENV LONGITUDE "36.9397"
ENV SENSORID "sensor1234"
ENV ZIPCODE "95023"
ENV INTERVAL "3"
ENV GOOGLE_CLOUD_PROJECT "snappy-premise-118915"
ENV GOOGLE_APPLICATION_CREDENTIALS "/app/key.json"
ENV GRPC_GO_LOG_SEVERITY_LEVEL "INFO"
RUN apk --no-cache --update add ca-certificates
WORKDIR /app
COPY --from=0 /src/main /app/
COPY --from=0 /src/key.json /app/
ENTRYPOINT /app/main
</code></pre>

<p>and the pod config looks like this:</p>

<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: sensorpub
spec:
  template:
    metadata:
      labels:
        app: sensorpub
    spec:
      volumes:
      - name: google-cloud-key
        secret:
          secretName: pubsub-key
      containers:
      - name: sensorgen
        image: gcr.io/snappy-premise-118915/sensorgen:v1
        volumeMounts:
        - name: google-cloud-key
          mountPath: /var/secrets/google
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /var/secrets/google/key.json
</code></pre>

<p>I want to be able to pass in these environment vars:</p>

<pre><code>ENV LATITUDE "-121.464"
ENV LONGITUDE "36.9397"
ENV SENSORID "sensor1234"
ENV ZIPCODE "95023"
ENV INTERVAL "3"
ENV GOOGLE_CLOUD_PROJECT "snappy-premise-118915"
ENV GOOGLE_APPLICATION_CREDENTIALS "/app/key.json"
ENV GRPC_GO_LOG_SEVERITY_LEVEL "INFO"
</code></pre>

<p>I want to be able to set the environment variables in the pod config so that the docker file can use those...how do I do that instead of just coding them into the docker image directly?</p>

<blockquote>
  <p>I want to be able to set the environment variables in the pod config so that the docker file can use those...how do I do that instead of just coding them into the docker image directly?</p>
</blockquote>

<p>There is no need to specify <strong>any</strong> <code>ENV</code> directive in a Dockerfile; those directives only provide defaults in the case where (as in your example <code>PodSpec</code>) they are not provided at runtime.</p>

<p>The "how" is to do exactly what you have done in your example <code>PodSpec</code>: populate the <code>env:</code> array with the environment variables you wish to appear in the Pod</p>
