puppetlabs / pupperware

Container fun time lives here.
Other
183 stars 67 forks source link

(maint) Enable Docker VOLUMEs for LCOW #143

Closed Iristyle closed 5 years ago

Iristyle commented 5 years ago

Part One

The first part of this PR was a crafty way to allow bind mounts to be used under LCOW, while allowing for named volumes to be used on Linux (for the same data - i.e. Postgres) without separate compose files:

   services:
     foo:
       volumes:
         - ${VOLUME_ROOT}foo:/tmp/bar

   volumes:
     foo:

On Windows, with VOLUME_ROOT set as c:\windows\temp\1234.hzs\ the evaluation is:

   services:
     foo:
       volumes:
         - c:\windows\temp\1234.hzs\foo:/tmp/bar

   volumes:
     foo:

A bind mount is used on Windows, instead of using the 'foo' volume which becomes extraneous (but harmless).

On platforms that don't have VOLUME_ROOT defined, the evaluation is:

   services:
     foo:
       volumes:
         - foo:/tmp/bar

   volumes:
     foo:

In this case, the named VOLUME 'foo' is used because a path is not specified (which would otherwise indicate a bind mount).

Part Two

The second part switches Azure / LCOW over to named volumes!

Part Three