Docker Image Components are ideal in situations where you don't already have your images built and ready to be used. Defining such a component will enable Bunnyshell to build your images for you automatically.
Docker Image components are not displayed in the main user interface. They can be defined and edited only with the env.yaml file, where they have their own kind, named DockerImage.
Docker Image Components have the following attributes:
context: the path to the Dockerfile relative to the Git branch.
dockerfile: the name of the Dockerfile. This attribute is relative to the context.
target: the name of the stage that is to be built from the Dockerfile.
args: Docker build args that can be used in the image.
version: Bunnyshell's definition version
name: the name
gitRepo: the URL of the Git repository where the Dockerfile is located. This field is mandatory.
gitBranch: the branch where the Dockerfile is located. This attribute is relative to the gitRepo. This field is mandatory.
gitApplicationPath: the path to the application folder, relative to the branch. This field is mandatory.
If the gitRepo, gitBranch and gitApplicationPath are not provided, Bunnyshell will return an error when trying to validate your environment.
Bunnyshell must have access to the git repository through an existing Git integration (i.e. a Git account that was already connected to Bunnyshell).
See the Git Version Control Systems page for more information.
Value Interpolation
The images can be used in other components using the following interpolations:
{{ components.dev_test_image.image }}: contains full image name, including the tag.
Example: nginx:latest
{{ components.dev_test_image.imageName }}: contains only the image name:
Example: nginx
{{ components.dev_test_image.imageTag }}: contains only the image tag.
Example: latest
The context, dockerfile, target and args can be used in value interpolation contexts. For args, especially, value interpolation is particularly useful, allowing you to use environment variables as arguments.