Skip to content

Commit 76d6139

Browse files
committed
build container images for the pods arch
Signed-off-by: Robert Detjens <[email protected]>
1 parent 7cc91f6 commit 76d6139

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/builder/docker.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ pub struct ContainerInfo {
2929
id: String,
3030
}
3131

32-
pub async fn build_image(context: &Path, options: &BuildObject, tag: &str) -> Result<String> {
32+
pub async fn build_image(
33+
context: &Path,
34+
options: &BuildObject,
35+
tag: &str,
36+
arch: &str,
37+
) -> Result<String> {
3338
trace!("building image in directory {context:?} to tag {tag:?}");
3439
let client = docker().await?;
3540

@@ -38,6 +43,7 @@ pub async fn build_image(context: &Path, options: &BuildObject, tag: &str) -> Re
3843
buildargs: options.args.clone(),
3944
t: tag.to_string(),
4045
forcerm: true,
46+
platform: format!("linux/{arch}"),
4147
..Default::default()
4248
};
4349

src/builder/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async fn build_challenge(
8080
Build(build) => {
8181
let tag = chal.container_tag_for_pod(profile_name, &p.name)?;
8282

83-
let res = docker::build_image(&chal.directory, build, &tag)
83+
let res = docker::build_image(&chal.directory, build, &tag, &p.architecture)
8484
.await
8585
.with_context(|| {
8686
format!(

0 commit comments

Comments
 (0)