unstructured/scripts/docker-build.sh
Roman Isecke 76efcf4dd7
chore: add shfmt (#2246)
### Description
Given all the shell files that now exist in the repo, would be nice to
have linting/formatting around them (in addition to the existing
shellcheck which doesn't do anything to format the shell code). This PR
introduces `shfmt` to both check for changes and apply formatting when
the associated make targets are called.
2023-12-12 01:04:15 +00:00

21 lines
641 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
DOCKER_REPOSITORY="${DOCKER_REPOSITORY:-quay.io/unstructured-io/unstructured}"
PIP_VERSION="${PIP_VERSION:-23.1.2}"
DOCKER_IMAGE="${DOCKER_IMAGE:-unstructured:dev}"
DOCKER_BUILD_CMD=(docker buildx build --load -f Dockerfile
--build-arg PIP_VERSION="$PIP_VERSION"
--build-arg BUILDKIT_INLINE_CACHE=1
--progress plain
--cache-from "$DOCKER_REPOSITORY":latest
-t "$DOCKER_IMAGE" .)
# only build for specific platform if DOCKER_BUILD_PLATFORM is set
if [ -n "${DOCKER_BUILD_PLATFORM:-}" ]; then
DOCKER_BUILD_CMD+=("--platform=$DOCKER_BUILD_PLATFORM")
fi
DOCKER_BUILDKIT=1 "${DOCKER_BUILD_CMD[@]}"