Skip to content

Commit

Permalink
Add helper scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeitong committed Aug 24, 2024
1 parent 9a720b4 commit fc7793f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

BASE="${BASE:-ghcr.io/zifeitong/ubuntu-devpack}"
TAG="${1:-devpack}"

podman pull $BASE
podman build . --build-arg USER=$USER --build-arg UID=$(id -u) --build-arg BASE=$BASE -t $TAG

VOLUME_NAME=$TAG-home
if ! podman volume inspect "$VOLUME_NAME" >/dev/null 2>&1; then
podman volume create $VOLUME_NAME --label devpack
fi
12 changes: 12 additions & 0 deletions run
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

IMAGE="${1:-devpack}"
COMMAND="${2:-fish}"

if [ -z "$SSH_AUTH_SOCK" ]; then
eval "$(ssh-agent -s >/dev/null 2>&1)"
fi

podman run --rm --interactive --tty --user=$USER --hostname $IMAGE -v $IMAGE-home:$HOME -v $(pwd):/src -v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK -w /src --rm --userns keep-id --privileged $IMAGE $COMMAND

0 comments on commit fc7793f

Please sign in to comment.