You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<tr><td><ahref="#stacker-build">stacker build</a></td><td>Build a new OCI image from a stacker yaml file</td></tr>
6
-
<tr><td><ahref="#stacker-recursive-build">stacker recursive-build</a></td><td>Find stacker yaml files under a directory and builds all OCI layers they define</td></tr>
7
-
<tr><td><ahref="#stacker-publish">stacker publish</a></td><td>Publish OCI images previously built from one or more stacker yaml files</td></tr>
8
-
<tr><td><ahref="#stacker-chroot-exec">stacker chroot</a></td><td>Run a command in a chroot (same as <code>stacker exec</code>)</td></tr>
9
-
<tr><td><ahref="#stacker-clean">stacker clean</a></td><td>Clean up after a stacker build</td></tr>
10
-
<tr><td><ahref="#stacker-inspect">stacker inspect</a></td><td>Print the json representation of an OCI image</td></tr>
11
-
<tr><td><ahref="#stacker-grab">stacker grab</a></td><td>Grab a file from the layer's filesystem</td></tr>
12
-
<tr><td><ahref="#stacker-unpriv-setup">stacker unpriv-setup</a></td><td>Do the necessary unprivileged setup for stacker build to work without root</td></tr>
7
+
<tr><td><ahref="#stacker-build">stacker build</a></td><td>Builds a new OCI image from a stacker yaml file</td></tr>
8
+
<tr><td><ahref="#stacker-recursive-build">stacker recursive-build</a></td><td>Finds stacker yaml files under a directory and builds all OCI images they define</td></tr>
9
+
<tr><td><ahref="#stacker-convert">stacker convert</a></td><td>Converts a Dockerfile into a stacker yaml file</td></tr>
10
+
<tr><td><ahref="#stacker-publish">stacker publish</a></td><td>Publishes OCI images previously built from one or more stacker yaml files</td></tr>
11
+
<tr><td><ahref="#stacker-chroot-exec">stacker chroot</a></td><td>Runs a command in a chroot (same as <code>stacker exec</code>)</td></tr>
12
+
<tr><td><ahref="#stacker-clean">stacker clean</a></td><td>Cleans up after a stacker build</td></tr>
13
+
<tr><td><ahref="#stacker-inspect">stacker inspect</a></td><td>Prints the json representation of an OCI image</td></tr>
14
+
<tr><td><ahref="#stacker-grab">stacker grab</a></td><td>Grabs a file from the image's filesystem</td></tr>
15
+
<tr><td><ahref="#stacker-unpriv-setup">stacker unpriv-setup</a></td><td>Does the necessary unprivileged setup for stacker build to work without root</td></tr>
13
16
<tr><td><ahref="#stacker-gc">stacker gc</a></td><td>Garbage collection of unused OCI imports/outputs snapshots</td></tr>
14
-
<tr><td><ahref="#stacker-check">stacker check</a></td><td>Check that all runtime required items (like kernel features) are present</td></tr>
15
-
<tr><td><ahref="#stacker-help">stacker help</a></td><td>Show a list of commands or help for one command</td></tr>
17
+
<tr><td><ahref="#stacker-check">stacker check</a></td><td>Checks that all runtime required items (like kernel features) are present</td></tr>
18
+
<tr><td><ahref="#stacker-help">stacker help</a></td><td>Shows a list of commands or help for one command</td></tr>
Copy file name to clipboardExpand all lines: docs/reference/stacker_file.md
+39-45
Original file line number
Diff line number
Diff line change
@@ -63,50 +63,42 @@ layer on a previously specified layer in the stacker file.
63
63
64
64
`scratch`: which is an empty rootfs and can be used to host statically built binaries.
65
65
66
-
### `import`
66
+
### `imports`
67
67
68
-
The `import` directive describes what files should be made available in
69
-
`/stacker` during the `run` phase. There are three forms of importing supported
70
-
today:
68
+
The `imports` directive describes what files should be made available in `/stacker/imports` during the `run` phase. There are three forms of importing supported today:
71
69
72
70
/path/to/file
73
71
74
-
Will import a file or directory from the local filesystem. If the file or
75
-
directory changes between stacker builds, it will be hashed and the new file
76
-
will be imported on subsequent builds.
72
+
Will import a file or directory from the local filesystem. If the file or directory changes between stacker builds, it will be hashed and the new file will be imported on subsequent builds.
77
73
78
74
http://example.com/foo.tar.gz
79
75
80
-
Will import foo.tar.gz and make it available in `/stacker`. Note that stacker
81
-
will NOT update this file unless the cache is cleared, to avoid excess network
82
-
usage. That means that updates after the first time stacker downloads the file
83
-
will not be reflected.
76
+
Will import foo.tar.gz and make it available in `/stacker`. Note that stacker will NOT update this file unless the cache is cleared, to avoid excess network usage. That means that updates after the first time stacker downloads the file will not be reflected.
84
77
85
78
stacker://$name/path/to/file
86
79
87
-
Will grab /path/to/file from the previously built layer`$name`.
80
+
Will grab /path/to/file from the previously built image`$name`.
88
81
89
82
#### `import hash`
90
83
91
-
The `import` directive also supports specifying the hash(sha256sum) of import source,
92
-
for all the three forms presented above, for example:
84
+
Each entry in the `import` directive also supports specifying the hash (sha256sum) of import source, for all the three forms presented above. For example:
93
85
```
94
-
import:
86
+
imports:
95
87
- path: config.json
96
88
hash: f55af805b012017bc....
97
89
- path: http://example.com/foo.tar.gz
98
90
hash: b458dfd63e7883a64....
99
91
- path: stacker://$name/path/to/file
100
92
hash: f805b012017bc769a....
101
93
```
102
-
Before copying the file it will check if the requested hash matches the actual one.
94
+
Before copying the file, stacker will check that the file's hash matches the given value. For file imports, the source file is hashed at build time. For HTTP imports, the value returned by the server in the `X-Checksum-Sha256` HTTP header is checked first. If that value matches, the file is downloaded and then hashed and compared again.
103
95
104
-
`stacker build` supports the flag `--require-flag` which checks that all http(s) remote
105
-
imports have an hash in all stacker YAMLs.
96
+
`stacker build` supports the flag `--require-hash`, which will cause a build error if any HTTP(S) remote imports do not have a hash specified, in all transitively included stacker YAMLs.
97
+
98
+
If `--require-hash` is not passed, this import mode can be combined with unchecked imports, and only files that have the hash specified will be checked.
106
99
107
-
This new import mode can be combined with the old one, for example:
108
100
```
109
-
import:
101
+
imports:
110
102
- path: "config.json
111
103
hash: "BEEFcafeaaaaAAAA...."
112
104
- /path/to/file
@@ -116,13 +108,17 @@ import:
116
108
117
109
The `import` directive also supports specifying the destination path (specified
118
110
by `dest`) in the resulting container image, where the source file (specified
119
-
by `path`) will be copyied to, for example:
111
+
by `path`) will be copyed to. For example:
120
112
```
121
-
import:
113
+
imports:
122
114
- path: config.json
123
115
dest: /
124
116
```
125
117
118
+
### `import` (Deprecated)
119
+
120
+
The deprecated `import` directive operates like `imports` except that the entries in the `import` array will be placed into `/stacker` instead of `/stacker/imports`.
121
+
126
122
### `overlay_dirs`
127
123
This directive works only with OverlayFS backend storage.
128
124
@@ -146,7 +142,7 @@ to be available under container's /usr/local/ and all the files/dirs from the ho
146
142
These correspond exactly to the similarly named bits in the [OCI image
When moving a project from a docker build environment to a stacker build environment, you can use the [`stacker convert`](../reference/stacker_cli.md#stacker-convert) command to create a stacker yaml file from the existing Dockerfile.
4
+
5
+
!!! note
6
+
7
+
The conversion is a best-effort process and may not be successful in all cases.
8
+
9
+
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.
10
+
11
+
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:
12
+
13
+
14
+
| Command option | Abbreviation | Default name |
15
+
| --- | --- | --- |
16
+
| --docker-file | -i | "Dockerfile" |
17
+
| --output-file | -o | "stacker.yaml" |
18
+
| --substitute-file | -s | "stacker-subs.yaml" |
19
+
20
+
21
+
To execute a conversion, use the following syntax:
0 commit comments