Option to use podman

This commit is contained in:
urob 2023-03-31 22:09:17 -04:00
parent f04448e0c0
commit 78b1142e6f
2 changed files with 14 additions and 9 deletions

View file

@ -90,6 +90,7 @@ done
[[ -z $CLEAR_CACHE ]] && CLEAR_CACHE="false"
DOCKER_IMG="zmkfirmware/zmk-dev-arm:$ZEPHYR_VERSION"
DOCKER_BIN="$SUDO podman"
# +-------------------------+
# | AUTOMATE CONFIG OPTIONS |
@ -127,7 +128,7 @@ fi
if [[ $RUNWITH_DOCKER = true ]]
then
echo "Build mode: docker"
DOCKER_CMD="$SUDO docker run --name zmk-$ZEPHYR_VERSION --rm \
DOCKER_CMD="$DOCKER_BIN run --name zmk-$ZEPHYR_VERSION --rm \
--mount type=bind,source=$HOST_ZMK_DIR,target=$DOCKER_ZMK_DIR \
--mount type=bind,source=$HOST_CONFIG_DIR,target=$DOCKER_CONFIG_DIR,readonly \
--mount type=volume,source=zmk-root-user-$ZEPHYR_VERSION,target=/root \
@ -138,7 +139,7 @@ then
# Reset volumes
if [[ $CLEAR_CACHE = true ]]
then
$SUDO docker volume rm $(sudo docker volume ls -q | grep "^zmk-.*-$ZEPHYR_VERSION$")
$DOCKER_BIN volume rm $($DOCKER_BIN volume ls -q | grep "^zmk-.*-$ZEPHYR_VERSION$")
fi
# Update west if needed