How can I combine ENV statement in Dockerfile?

As an exameple with the RUN statement, if my code is:

RUN apt-get update
RUN apt-get install git
RUN apt-get clean

I can do:

  • Kubernetes ACS engine: containers (pods) do not have internet access
  • docker swarm certificate expiry
  • Failed to load OSETUP.dll when installing Excel in Windows docker container
  • Docker mount happens before or after entrypoint execution
  • Unable to access Container url in Bluemix for Spring Boot Application
  • is it reasonable to run docker processes under runit/daemontools supervision
  • RUN apt-get update && apt-get install git && apt-get clean
    

    If my ENV is:

    ENV POSTGRES_PASSWORD postgres
    ENV POSTGRES_USER postgres
    ENV POSTGRES_DB postgres
    ENV POSTGRES_HOST db
    

    How can I combine ENV statement in one line?

  • How to use fontawesome with vue.js
  • Docker container cannot resolve website names, but can ping their ip
  • Is it possible to create image from file on docker host using docker API?
  • Docker expose port
  • How to get started with dockerode
  • Unable to access Container url in Bluemix for Spring Boot Application
  • One Solution collect form web for “How can I combine ENV statement in Dockerfile?”

    Example from the Dockerfile reference

    https://docs.docker.com/engine/reference/builder/#env

    ENV myName="John Doe" myDog=Rex\ The\ Dog \
        myCat=fluffy
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.