refactor: use DOCKER_BIN env var instead of calling docker directly

This will allow us to alias the docker binary with podman for most actions - other than updating running containers.
This commit is contained in:
Jose Diaz-Gonzalez
2023-02-07 03:53:08 -05:00
parent b50752d009
commit 646356d086
5 changed files with 38 additions and 38 deletions

View File

@@ -46,7 +46,7 @@ service-destroy-cmd() {
service_container_rm "$SERVICE"
dokku_log_verbose_quiet "Removing data"
docker container run --rm -v "$SERVICE_HOST_ROOT/data:/data" -v "$SERVICE_HOST_ROOT/$PLUGIN_CONFIG_SUFFIX:/config" "$PLUGIN_BUSYBOX_IMAGE" chmod 777 -R /config /data
"$DOCKER_BIN" container run --rm -v "$SERVICE_HOST_ROOT/data:/data" -v "$SERVICE_HOST_ROOT/$PLUGIN_CONFIG_SUFFIX:/config" "$PLUGIN_BUSYBOX_IMAGE" chmod 777 -R /config /data
rm -rf "$SERVICE_ROOT"
plugn trigger service-action post-delete "$PLUGIN_COMMAND_PREFIX" "$SERVICE"

View File

@@ -45,7 +45,7 @@ service-upgrade-cmd() {
dokku_log_warn "$PLUGIN_SERVICE service $SERVICE upgrade failed"
exit 1
fi
docker image pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" || dokku_log_fail "$PLUGIN_SERVICE image $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION pull failed"
"$DOCKER_BIN" image pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" || dokku_log_fail "$PLUGIN_SERVICE image $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION pull failed"
fi
service_commit_config "$SERVICE"