Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Commit 75b6be5

Browse files
authored
Merge pull request #20 from duck-rh/configurable_command
2 parents 3233a44 + 9bda991 commit 75b6be5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

custom_base.template.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@
88
# Mount additional volumes into the container or limit the CPU utilization.
99
# PODMAN_RUN_ARGS[0]='--volume=/mnt:/path/in/container:z'
1010
# PODMAN_RUN_ARGS[1]='--cpus=1'
11+
12+
# Change the command given to `podman run` in `prepare.sh`.
13+
# This command *must* not return or the container could stop before the
14+
# tasks are done. The default is to call `sleep` with a very long time.
15+
# PODMAN_RUN_COMMAND=/sbin/init

prepare.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ start_container() {
5757

5858
podman pull --authfile "$CACHE_DIR"/_authfile_"$CONTAINER_ID" "$IMAGE"
5959
rm "$CACHE_DIR"/_authfile_"$CONTAINER_ID"
60+
# We want shell splitting on PODMAN_RUN_COMMAND
61+
# shellcheck disable=2086
6062
podman run \
6163
--detach \
6264
--name "$CONTAINER_ID" \
6365
--volume "$CACHE_DIR:/home/user/cache":z \
6466
"${PODMAN_RUN_ARGS[@]}" \
6567
"$IMAGE"\
66-
sleep 999999999
68+
${PODMAN_RUN_COMMAND:-sleep 999999999}
6769
}
6870

6971
install_command() {

0 commit comments

Comments
 (0)