This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Fetch via container-image-proxy
https://github.com/cgwalters/container-image-proxy is prototype code to expose containers/image via a HTTP API suitable for use in non-Go programs. This has many advantages over us forking skopeo; the key one being on-demand layer fetching.
- Loading branch information
Showing
8 changed files
with
207 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -xeuo pipefail | ||
|
||
yum -y install skopeo | ||
yum -y --enablerepo=updates-testing update ostree-devel | ||
|
||
git clone --depth=1 https://github.com/cgwalters/container-image-proxy | ||
cd container-image-proxy | ||
make | ||
install -m 0755 bin/container-image-proxy /usr/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::os::unix::prelude::{AsRawFd, CommandExt, RawFd}; | ||
|
||
pub(crate) trait CommandRedirectionExt { | ||
fn take_fd_n(&mut self, fd: i32, target: i32) -> &mut Self; | ||
} | ||
|
||
#[allow(unsafe_code)] | ||
impl CommandRedirectionExt for std::process::Command { | ||
fn take_fd_n(&mut self, fd: i32, target: i32) -> &mut Self { | ||
unsafe { | ||
self.pre_exec(move || { | ||
nix::unistd::dup2(fd, target as RawFd) | ||
.map(|_r| ()) | ||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, format!("{}", e))) | ||
}); | ||
} | ||
self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.