1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Command override for container and dockerfile resources.
//!
//! [`Command`] is used in the `command` field of [`crate::ContainerConfig`] and
//! [`crate::DockerfileConfig`] to override the image default `CMD`.
use JsonSchema;
use ;
/// Override for the image default `CMD`.
///
/// Two forms are accepted in the manifest YAML:
///
/// - A single string is interpreted shell-style, equivalent to wrapping
/// the value in `sh -c "..."`. Convenient for one-liners.
/// - An array of strings is passed directly to the container runtime as
/// an argument vector, giving precise control over quoting and
/// whitespace.
///
/// Either form becomes the container `Cmd`. The image `ENTRYPOINT` is
/// preserved: it is never overridden, so an image declaring
/// `ENTRYPOINT ["/usr/local/bin/app"]` runs that binary with this value
/// appended as its arguments. Against such an image, a startup shim
/// written as `sh -c "..."` is not executed as a command of its own; it
/// reaches the entrypoint binary as positional arguments, which most
/// argument parsers reject. Only images whose entrypoint is a shell, or
/// which declare no entrypoint at all, run this value directly.
///
/// Used in the `command` field of [`crate::ContainerConfig`] and
/// [`crate::DockerfileConfig`].