Skip to content

Commit 8eda2b0

Browse files
allisonkarlitskayacgwalters
authored andcommitted
oci: workaround for skopeo containers-storage: bug
We can't clone from `containers-storage:` image locations using containers-image-proxy-rs due to a bug in the proxy implementation in skopeo. Fortunately, the issue is well understood and we have a decent workaround for it. Signed-off-by: Allison Karlitskaya <[email protected]>
1 parent 9b2e75c commit 8eda2b0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/oci/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::process::Command;
2+
13
pub mod image;
24
pub mod tar;
35

@@ -63,7 +65,17 @@ type ContentAndVerity = (Sha256HashValue, Sha256HashValue);
6365

6466
impl<'repo> ImageOp<'repo> {
6567
async fn new(repo: &'repo Repository, imgref: &str) -> Result<Self> {
68+
// See https://github.com/containers/skopeo/issues/2563
69+
let skopeo_cmd = if imgref.starts_with("containers-storage:") {
70+
let mut cmd = Command::new("podman");
71+
cmd.args(["unshare", "skopeo"]);
72+
Some(cmd)
73+
} else {
74+
None
75+
};
76+
6677
let config = ImageProxyConfig {
78+
skopeo_cmd,
6779
// auth_anonymous: true, debug: true, insecure_skip_tls_verification: Some(true),
6880
..ImageProxyConfig::default()
6981
};

0 commit comments

Comments
 (0)