Skip to content

Commit

Permalink
infra/image/shcontainer: New container_copy and container_fetch
Browse files Browse the repository at this point in the history
container_copy can be used to copy a file to the container,
container_fetch can be used to copy a file from the container.

For more information, please have a look at the podman-cp man page.
  • Loading branch information
t-woerner committed Nov 19, 2024
1 parent d580431 commit 82a53b9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions infra/image/shcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,23 @@ container_image_list() {
container_check() {
[ -n "$(command -v "podman")" ] || die "podman is required."
}

container_copy() {
local name="${1}"
local source="${2}"
local destination="${3}"

log info "= Copying ${source} to ${name}:${destination} ="
podman cp "${source}" "${name}:${destination}"
echo
}

container_fetch() {
local name="${1}"
local source="${2}"
local destination="${3}"

log info "= Copying ${name}:${source} to ${destination} ="
podman cp "${name}:${source}" "${destination}"
echo
}

0 comments on commit 82a53b9

Please sign in to comment.