fix: hide podman pull errors

This commit is contained in:
Job
2024-12-22 15:03:09 +01:00
parent 8f4539b1a0
commit 7828f94011

View File

@@ -33,8 +33,8 @@ run_args() {
[ -d "$HOME/.config/git" ] && arg "-v $HOME/.config/git:/home/user/.config/git" [ -d "$HOME/.config/git" ] && arg "-v $HOME/.config/git:/home/user/.config/git"
# Mount host directories with programming projects. # Mount host directories with programming projects.
[ -d "$HOME/Documents" ] && arg "-v $HOME/Documents:/home/user/Documents" [ -d "$HOME/Code" ] && arg "-v $HOME/Code:/home/user/Code"
[ -d "$HOME/.local/share/devcontainer" ] && arg "-v $HOME/.local/share/devcontainer:/home/user/.dev" [ -d "$HOME/.config/devcontainer" ] && arg "-v $HOME/.config/devcontainer:/home/user/.dev"
# Add volumes for .local and .cache so these survive # Add volumes for .local and .cache so these survive
# container restarts. # container restarts.
@@ -43,8 +43,8 @@ run_args() {
} }
### MAIN ### ### MAIN ###
name="dev" name="devcontainer"
image="git.plabble.org/job79/dev:latest" image="ghcr.io/job79/devcontainer:latest"
fetch=false fetch=false
while test $# -gt 0; do while test $# -gt 0; do
@@ -58,8 +58,8 @@ while test $# -gt 0; do
done done
if [ "$fetch" = true ] || [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ]; then if [ "$fetch" = true ] || [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ]; then
log "fetching updates..." log "fetching devcontainer updates..."
if [ "$(podman pull -q "$image")" != "$(podman container inspect "$name" -f {{.Image}} 2>&1)" ]; then if [ "$(podman pull -q "$image" 2>&1)" != "$(podman container inspect "$name" -f {{.Image}} 2>&1)" ]; then
log "container image downloaded" '✓' 32 log "container image downloaded" '✓' 32
podman container rm -f -t 1 "$name" 1>/dev/null podman container rm -f -t 1 "$name" 1>/dev/null
podman run -td $(run_args) "$image" podman run -td $(run_args) "$image"