Provision system is only available in Docker images which are based on
Custom entrypoint scripts¶
Shell scripts (
*.sh) for container startup can be placed inside following directories:
These files (
*.sh) will be executed automatically.
||Run on Docker image creation (only run once)|
||Run on Docker image build|
||Run on Docker image ONBUILD|
||Run on Docker image entrypoint execution (only here Environment variables are available)|
Try to avoid entrypoint provision tasks because it delays startup time.
Shell script provision¶
For each provision event there is a directory for shell scripts:
For customization just add your shell scripts into these directories for the simple shell script provision system.
For Ansible the provision events are available as tags. The roles are located inside
and must be registred with the provision system:
/opt/docker/bin/provision add --tag bootstrap --role my-own-role
Multiple tags can be defined with multiple
/opt/docker/bin/provision add --tag bootstrap --tag build --role my-own-role
There is a pritory system for roles in which order they should be executed, default priority is 100:
## run before /opt/docker/bin/provision add --tag bootstrap --priority 40 --role my-own-role-first ## run with normal priority /opt/docker/bin/provision add --tag bootstrap --role my-own-role ## run after /opt/docker/bin/provision add --tag bootstrap --priority 200 --role my-own-role-last
It’s also possible to run one role with the provision command:
/opt/docker/bin/provision run --tag bootstrap --role my-own-role