Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement baking #849

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/849.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"description": "enable using `buildx bake` and `buildx imagetools` for building cross images with `build-docker-image`",
"type": "internal"
}
]
3 changes: 3 additions & 0 deletions src/docker/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ impl std::str::FromStr for ImagePlatform {
value::{Error as SerdeError, StrDeserializer},
IntoDeserializer,
};
if s.contains(',') {
eyre::bail!("invalid platform, found unexpected character `,`");
}
if let Some((platform, toolchain)) = s.split_once('=') {
let image_toolchain = toolchain.into();
let (os, arch, variant) = if let Some((os, rest)) = platform.split_once('/') {
Expand Down
4 changes: 3 additions & 1 deletion src/docker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ impl ProvidedImage {
}

pub fn image_name(target: &str, sub: Option<&str>, repository: &str, tag: &str) -> String {
if let Some(sub) = sub {
if tag.is_empty() {
format!("{repository}/{target}")
} else if let Some(sub) = sub {
format!("{repository}/{target}:{tag}-{sub}")
} else {
format!("{repository}/{target}:{tag}")
Expand Down
Loading