This guide covers CCP specific requirements for defining Docker images.
All docker files should be located in docker/<component_name> directory, for example:
docker/horizon
docker/keystone
The docker directory may contain multiple components.
Each docker directory should contain a Dockerfile.j2 file. Dockerfile.j2 is a file which contains Docker build instructions in a Jinja2 template format. You can add additional files, which will be used in Dockerfile.j2, but only Dockerfile.j2 can be a Jinja2 template in this directory.
Please refer to the official Docker documentation which covers the Dockerfile format. CCP has some additional requirements, which is:
Here is an example of valid Dockerfile.j2: Keystone Dockerfile
Only specific variables can actually be used in Dockerfile.j2:
The CCP CLI provides additional feature for Docker images creation, which will help to use git repositories inside Dockerfile, it’s called copy_sources.
This feature uses configuration from service/files/defaults.yaml from the same repository or from global config, please refer to Application definition contribution guide for details.
After making any changes in docker directory, you should test it via build and deploy.
To test building, please run:
ccp build -c <component_name>
For example:
ccp build -c keystone
Make sure that image is built without errors.
To test the deployment, please build new images using the steps above and after run:
ccp deploy
Please refer to Quick Start for additional information.