Convert a Dockerfile to stacker yaml¶
When moving a project from a docker build environment to a stacker build environment, you can use the stacker convert
command to create a stacker yaml file from the existing Dockerfile.
Note
The conversion is a best-effort process and may not be successful in all cases.
During the conversion, variables from the Dockerfile may be exported to a substitution file, which can be declared in the stacker build
command when building the project.
When invoking the stacker convert
command, you have the option to specify the input (Dockerfile) filename, an output (stacker) filename, and a name for a substitution file, if such a file is generated by the conversion. Alternatively, you can use the default names provided:
Command option | Abbreviation | Default name |
---|---|---|
--docker-file | -i | "Dockerfile" |
--output-file | -o | "stacker.yaml" |
--substitute-file | -s | "stacker-subs.yaml" |
To execute a conversion, use the following syntax:
stacker convert [-i <name>] [-o <name>] [-s <name>]