Use the following command to install the Docker plugin in your current Docker CLI installation
make install-plugins
Test the installation using docker render from your Terminal.
Usage
Once you've installed the Docker plugin you can use as following
docker render [OPTIONS] <context_path>
With the following options:
Name
Description
Required
Default value
file-name
The name of the template file
False
Dockerfile.template
output
The name of the outputfile, if it's an empty string the result will be printed on stdout
False
values
The path for the values file. If an absolute path is passed context path will be ignored. Otherwise it will be joined to the conext path
False
docker-values.yaml
Example
Once you've installed the Docker plugin you can follow the below steps:
Create a Dockerfile.template with the following content
# Use an official base image
FROM {{.BaseImage}}
# Set the exposed port
EXPOSE {{.Deployment.ExposedPort}}
# Set environment variables
{{range .Deployment.Environment}}
ENV {{.Name}}="{{.Value}}"
{{end}}
# Copy source code
COPY . {{.CopyDestination}}
# Run command
CMD {{.RunCommand}}
Create a docker-values.yaml file with the following content: