Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new -overlay option to overlay files prior to templatizing #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

markriggins
Copy link

- 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

}
return env
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this confusing -- I thought it was somehow related to golang.org/x/net/context.Context and the ctx variable. So I renamed it to EnvContext and moved it into templates.go, which is the only place its used

@markriggins markriggins force-pushed the master branch 3 times, most recently from accfdf7 to c26f3e3 Compare March 29, 2016 19:20
    - 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant