nanite_docker/instruction/
mod.rs1mod add;
7mod arg;
8mod cmd;
9mod copy;
10mod entrypoint;
11mod env;
12mod expose;
13mod healthcheck;
14mod label;
15mod maintainer;
16mod onbuild;
17mod run;
18mod shell;
19mod stopsignal;
20mod user;
21mod volume;
22mod workdir;
23
24pub use add::{Add, AddOpt};
27pub use arg::Arg;
28pub use cmd::Cmd;
29pub use copy::{Copy, CopyOpt};
30pub use entrypoint::Entrypoint;
31pub use env::Env;
32pub use expose::{Expose, ExposeProtocol};
33pub use healthcheck::{HealthCheck, HealthCheckOpt};
34pub use label::Label;
35pub use maintainer::Maintainer;
36pub use onbuild::OnBuild;
37pub use run::{
38 Run, RunMount, RunMountBind, RunMountBindOpts, RunMountCache, RunMountCacheOpts, RunMountSSH,
39 RunMountSSHOpts, RunMountSecret, RunMountSecretOpts, RunMountTmpfs, RunMountTmpfsOpts,
40 RunNetwork, RunSecurity, RunSharing,
41};
42pub use shell::Shell;
43pub use stopsignal::StopSignal;
44pub use user::User;
45pub use volume::Volume;
46pub use workdir::WorkDir;
47
48use core::fmt::{Display, Formatter};
49
50#[derive(Debug, Clone)]
54pub enum Instruction {
55 Add(Add),
56 Arg(Arg),
57 Cmd(Cmd),
58 Copy(Copy),
59 Entrypoint(Entrypoint),
60 Env(Env),
61 Expose(Expose),
62 HealthCheck(HealthCheck),
63 Label(Label),
64 Maintainer(Maintainer),
65 OnBuild(OnBuild),
66 Run(Run),
67 Shell(Shell),
68 StopSignal(StopSignal),
69 User(User),
70 Volume(Volume),
71 Workdir(WorkDir),
72}
73
74impl Display for Instruction {
75 fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
76 match self {
77 Self::Add(e) => write!(f, "{e}"),
78 Self::Arg(e) => write!(f, "{e}"),
79 Self::Cmd(e) => write!(f, "{e}"),
80 Self::Copy(e) => write!(f, "{e}"),
81 Self::Entrypoint(e) => write!(f, "{e}"),
82 Self::Env(e) => write!(f, "{e}"),
83 Self::Expose(e) => write!(f, "{e}"),
84 Self::HealthCheck(e) => write!(f, "{e}"),
85 Self::Label(e) => write!(f, "{e}"),
86 Self::Maintainer(e) => write!(f, "{e}"),
87 Self::OnBuild(e) => write!(f, "{e}"),
88 Self::Run(e) => write!(f, "{e}"),
89 Self::Shell(e) => write!(f, "{e}"),
90 Self::StopSignal(e) => write!(f, "{e}"),
91 Self::User(e) => write!(f, "{e}"),
92 Self::Volume(e) => write!(f, "{e}"),
93 Self::Workdir(e) => write!(f, "{e}"),
94 }
95 }
96}
97
98#[derive(Debug, Clone)]
100pub enum PreFromInstruction {
101 Arg(Arg),
102 Label(Label),
103}
104impl Display for PreFromInstruction {
105 fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
106 match self {
107 Self::Arg(e) => write!(f, "{e}"),
108 Self::Label(e) => write!(f, "{e}"),
109 }
110 }
111}