Skip to content

Commit 1e5c3ca

Browse files
Merge #1064
1064: add `CROSS_BUILD_OPTS` and `--build-opts` to enable passing more flags r=Alexhuszagh a=Emilgardis useful for passing `--network=host` Co-authored-by: Emil Gardström <[email protected]>
2 parents 62b8a69 + 812a12b commit 1e5c3ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

xtask/src/build_docker_image.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ pub struct BuildDockerImage {
1313
pub ref_type: Option<String>,
1414
#[clap(long, hide = true, env = "GITHUB_REF_NAME")]
1515
ref_name: Option<String>,
16+
/// Pass extra flags to the build
17+
#[clap(long, env = "CROSS_BUILD_OPTS")]
18+
build_opts: Option<String>,
1619
#[clap(action, long = "latest", hide = true, env = "LATEST")]
1720
is_latest: bool,
1821
/// Specify a tag to use instead of the derived one, eg `local`
@@ -96,6 +99,7 @@ pub fn build_docker_image(
9699
BuildDockerImage {
97100
ref_type,
98101
ref_name,
102+
build_opts,
99103
is_latest,
100104
tag: tag_override,
101105
repository,
@@ -290,6 +294,10 @@ pub fn build_docker_image(
290294
docker_build.args(["--build-arg", "VERBOSE=1"]);
291295
}
292296

297+
if let Some(opts) = &build_opts {
298+
docker_build.args(docker::parse_docker_opts(opts)?);
299+
}
300+
293301
if target.needs_workspace_root_context() {
294302
docker_build.arg(&root);
295303
} else {

0 commit comments

Comments
 (0)