Skip to content

Commit 7d52618

Browse files
committed
fix: remove docker container after exit
The build script leaves multiple containers in a host environment. This update adds an `--rm` option to remove a Docker container after a command is executed. Signed-off-by: Evgeny Semenov <[email protected]>
1 parent 7e6266d commit 7d52618

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/setup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ elif [ "${CONTAINER_TYPE}" == "docker" -o "${CONTAINER_TYPE}" == "podman" ]; the
126126
SELINUX_LABEL=""
127127
fi
128128
if [ -t 1 -a -t 0 ]; then
129-
CONTAINER_BASE="${CONTAINER_TYPE} run -it -v ${ROOT}:${ROOT}${SELINUX_LABEL} -w ${ROOT} riscvintl/udb:${CONTAINER_TAG}"
129+
CONTAINER_BASE="${CONTAINER_TYPE} run --rm -it -v ${ROOT}:${ROOT}${SELINUX_LABEL} -w ${ROOT} riscvintl/udb:${CONTAINER_TAG}"
130130
else
131-
CONTAINER_BASE="${CONTAINER_TYPE} run -v ${ROOT}:${ROOT}${SELINUX_LABEL} -w ${ROOT} riscvintl/udb:${CONTAINER_TAG}"
131+
CONTAINER_BASE="${CONTAINER_TYPE} run --rm -v ${ROOT}:${ROOT}${SELINUX_LABEL} -w ${ROOT} riscvintl/udb:${CONTAINER_TAG}"
132132
fi
133133
elif [ "${CONTAINER_TYPE}" == "singularity" ]; then
134134
CONTAINER_PATH=${ROOT}/.singularity/image-$CONTAINER_TAG.sif

0 commit comments

Comments
 (0)