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:

  • dotnet core on docker performance
  • How to “undeclare” volumes in docker image?
  • Elastic Beanstalk Multi-Container Environment cannot mount fuse mount as docker volume
  • Windows docker build fail when adding files into /etc/my_init.d/
  • How to update rails app on production with Docker and Fig with zero downtime?
  • Systemd dockerized service status=7/NOTRUNNING
  • 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 scale a NodeJS stateful application
  • In Docker, can I allow IIS to output detailed errors in a container running an MVC project?
  • Docker Swarm with Consul - Manager not electing primary
  • Ngrok: Expose Database in Docker Container
  • Correct method of pushing to a docker registry from local
  • Destroy Docker container from Marathon kills Mesos slave
  • 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.