File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ checks as part of a container build
5
5
6
6
# SYNOPSIS
7
7
8
- ** bootc container lint** \[ ** -h** \| ** \- -help** \]
8
+ ** bootc container lint** \[ ** \- -rootfs ** \] \[ ** -h** \| ** \- -help** \]
9
9
10
10
# DESCRIPTION
11
11
@@ -17,6 +17,10 @@ part of a build process; it will error if any problems are detected.
17
17
18
18
# OPTIONS
19
19
20
+ ** \- -rootfs** =* ROOTFS* \[ default: /\]
21
+
22
+ : Operate on the provided rootfs
23
+
20
24
** -h** , ** \- -help**
21
25
22
26
: Print help (see a summary with -h)
Original file line number Diff line number Diff line change @@ -245,7 +245,11 @@ pub(crate) enum ContainerOpts {
245
245
///
246
246
/// This is intended to be invoked via e.g. `RUN bootc container lint` as part
247
247
/// of a build process; it will error if any problems are detected.
248
- Lint ,
248
+ Lint {
249
+ /// Operate on the provided rootfs.
250
+ #[ clap( long, default_value = "/" ) ]
251
+ rootfs : Utf8PathBuf ,
252
+ } ,
249
253
}
250
254
251
255
/// Subcommands which operate on images.
@@ -1014,13 +1018,13 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
1014
1018
Opt :: Edit ( opts) => edit ( opts) . await ,
1015
1019
Opt :: UsrOverlay => usroverlay ( ) . await ,
1016
1020
Opt :: Container ( opts) => match opts {
1017
- ContainerOpts :: Lint => {
1021
+ ContainerOpts :: Lint { rootfs } => {
1018
1022
if !ostree_ext:: container_utils:: is_ostree_container ( ) ? {
1019
1023
anyhow:: bail!(
1020
1024
"Not in a ostree container, this command only verifies ostree containers."
1021
1025
) ;
1022
1026
}
1023
-
1027
+ let root = & Dir :: open_ambient_dir ( rootfs , cap_std :: ambient_authority ( ) ) ? ;
1024
1028
lints:: lint ( root) ?;
1025
1029
Ok ( ( ) )
1026
1030
}
You can’t perform that action at this time.
0 commit comments