Skip to content

Commit 4bb839c

Browse files
vmagrometa-codesync[bot]
authored andcommitted
[antlir2][docker_archive] add support for adding RepoTags
Differential Revision: D85365439 fbshipit-source-id: 8863adde11cfffeb5c824dff1d8871df0c31d63f
1 parent 3aa5a8f commit 4bb839c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

antlir/antlir2/antlir2_packager/src/docker_archive.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use crate::run_cmd;
2424
pub struct DockerArchive {
2525
build_appliance: BuildAppliance,
2626
oci: PathBuf,
27+
repo_tags: Vec<String>,
2728
}
2829

2930
impl DockerArchive {
@@ -50,6 +51,11 @@ impl DockerArchive {
5051
.command("skopeo")?
5152
.arg("copy")
5253
.arg(oci_arg)
54+
.args(
55+
self.repo_tags
56+
.iter()
57+
.map(|t| format!("--additional-tag={t}")),
58+
)
5359
.arg("docker-archive:/__antlir2__/out/docker_archive"),
5460
)
5561
.context("Failed to convert to docker-archive")?;

antlir/antlir2/bzl/package/docker_archive.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def _impl(ctx: AnalysisContext) -> Promise:
2222
{"docker_archive": {
2323
"build_appliance": build_appliance[BuildApplianceInfo].dir,
2424
"oci": oci,
25+
"repo_tags": ctx.attrs.repo_tags,
2526
}},
2627
with_inputs = True,
2728
)
@@ -51,7 +52,9 @@ def _impl(ctx: AnalysisContext) -> Promise:
5152

5253
_docker_archive = rule(
5354
impl = _impl,
54-
attrs = oci_attrs | layer_attrs | default_attrs | common_attrs,
55+
attrs = {
56+
"repo_tags": attrs.list(attrs.string(), default = []),
57+
} | oci_attrs | layer_attrs | default_attrs | common_attrs,
5558
cfg = package_cfg,
5659
)
5760

0 commit comments

Comments
 (0)