Compare commits
2 Commits
0e53249507
...
73f25ab8d2
Author | SHA1 | Date | |
---|---|---|---|
73f25ab8d2 | |||
c84f7ec54f |
@ -118,7 +118,6 @@ start_container_if_needed() {
|
|||||||
if ! podman container exists "$WORKSPACE"; then
|
if ! podman container exists "$WORKSPACE"; then
|
||||||
log INFO "Creating container '$WORKSPACE'"
|
log INFO "Creating container '$WORKSPACE'"
|
||||||
generate_gitconfig "$PERSON"
|
generate_gitconfig "$PERSON"
|
||||||
read -r -d '' key <"$HOME"/secrets/"$WORKSPACE"/id_ed25519
|
|
||||||
podman run -dit \
|
podman run -dit \
|
||||||
--name "$WORKSPACE" \
|
--name "$WORKSPACE" \
|
||||||
--userns=keep-id:uid=1000,gid=1000 \
|
--userns=keep-id:uid=1000,gid=1000 \
|
||||||
@ -126,13 +125,14 @@ start_container_if_needed() {
|
|||||||
--user "$DEV_USER" \
|
--user "$DEV_USER" \
|
||||||
--hostname "$WORKSPACE" \
|
--hostname "$WORKSPACE" \
|
||||||
--label auto-cleanup=true \
|
--label auto-cleanup=true \
|
||||||
|
-e SSH_KEY="$(cat $HOME/secrets/$WORKSPACE/id_ed25519)" \
|
||||||
-v "/mnt/private/workspaces-data/public/$WORKSPACE:/app/public" \
|
-v "/mnt/private/workspaces-data/public/$WORKSPACE:/app/public" \
|
||||||
-v "/mnt/private/workspaces-data/private/$WORKSPACE:/app/private" \
|
-v "/mnt/private/workspaces-data/private/$WORKSPACE:/app/private" \
|
||||||
-v "$HOME/secrets/$WORKSPACE/gitconfig:/home/$DEV_USER/.gitconfig:ro,Z" \
|
-v "$HOME/secrets/$WORKSPACE/gitconfig:/home/$DEV_USER/.gitconfig:ro,Z" \
|
||||||
-v "$HOME/secrets/$WORKSPACE/id_ed25519:/home/$DEV_USER/.ssh/id_ed25519:ro,Z" \
|
-v "$HOME/secrets/$WORKSPACE/id_ed25519:/home/$DEV_USER/.ssh/id_ed25519:ro,Z" \
|
||||||
-v "$HOME/secrets/$WORKSPACE/id_ed25519.pub:/home/$DEV_USER/.ssh/id_ed25519.pub:ro,Z" \
|
-v "$HOME/secrets/$WORKSPACE/id_ed25519.pub:/home/$DEV_USER/.ssh/id_ed25519.pub:ro,Z" \
|
||||||
--entrypoint "/home/$DEV_USER/start.sh" \
|
--entrypoint "/home/$DEV_USER/start.sh" \
|
||||||
"$IMAGE" "$TMUX_SESSION" "$key"
|
"$IMAGE" "$TMUX_SESSION"
|
||||||
elif ! podman inspect -f '{{.State.Running}}' "$WORKSPACE" | grep -q true; then
|
elif ! podman inspect -f '{{.State.Running}}' "$WORKSPACE" | grep -q true; then
|
||||||
log INFO "Starting existing container '$WORKSPACE'"
|
log INFO "Starting existing container '$WORKSPACE'"
|
||||||
podman start "$WORKSPACE" >/dev/null
|
podman start "$WORKSPACE" >/dev/null
|
||||||
|
Reference in New Issue
Block a user