You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new -overlay option to overlay files prior to templatizing
- overlays files onto the container at run-time, allowing for entire directory trees of files
to be dropped into a container based on ENV settings
`dockerize -overlay "/tmp/overlays/_common/html:/usr/share/nginx/" \
-overlay "/tmp/overlays/{{ .Env.DEPLOYMENT_ENV }}/html:/usr/share/nginx/" ...`
Small improvements:
- rename Context to EnvContext and move it into template.go, which is the
only place it is used.
- Add early exit to waitForDependencies() if waitFlag is nil
- string_template_eval utility function added
- apply string_template_eval to -template args so users use ENV vars to select the desired template
at run-time like this:
`dockerize -template '/etc/nginx/sites-available/{{ .Env FLAVOR }}.default.tmpl:/etc/nginx/sites-available/default'
Nginx Example improvements
- FROM nginx:1.9 is MUCH faster than compiling your own nginx
- Add a Makefile for examples/nginx
- Install the locally built image of "dockerize" into nginx, this greatly simplifies testing
You can overlay files onto the container at runtime by passing `-overlay` multiple times. The argument uses a form similar to the `--volume` option of the `docker run` command: `source:dest`. Overlays are applied recursively onto the destination in a similar manner to `cp -rv`. If multiple overlays are specified, they are applied in the order in which they were listed on the command line.
72
+
73
+
Overlays are used to replace entire sets of files with alternative content, whereas templates allow environment substitutions into a single file. The example below assumes that /tmp/overlays has already been COPY'd into the image by the Dockerfile.
0 commit comments