2023-06-20 16:00:55 -07:00
|
|
|
#!/usr/bin/env bash
|
2023-03-14 13:40:01 -07:00
|
|
|
|
|
|
|
set -euo pipefail
|
2023-04-06 00:34:07 -07:00
|
|
|
DOCKER_REPOSITORY="${DOCKER_REPOSITORY:-quay.io/unstructured-io/unstructured}"
|
2023-05-08 23:08:10 -07:00
|
|
|
PIP_VERSION="${PIP_VERSION:-23.1.2}"
|
2023-04-06 10:03:42 -07:00
|
|
|
DOCKER_IMAGE="${DOCKER_IMAGE:-unstructured:dev}"
|
2023-03-14 13:40:01 -07:00
|
|
|
|
2024-05-17 15:27:20 -04:00
|
|
|
DOCKER_BUILD_CMD=(docker buildx build --load -f Dockerfile-amd64
|
2023-12-18 23:48:21 -08:00
|
|
|
--build-arg PIP_VERSION="$PIP_VERSION"
|
|
|
|
--build-arg BUILDKIT_INLINE_CACHE=1
|
|
|
|
--progress plain
|
2024-05-15 18:53:15 -04:00
|
|
|
--platform linux/amd64
|
2023-12-18 23:48:21 -08:00
|
|
|
--cache-from "$DOCKER_REPOSITORY":latest
|
|
|
|
-t "$DOCKER_IMAGE" .)
|
2023-04-06 00:34:07 -07:00
|
|
|
|
|
|
|
# only build for specific platform if DOCKER_BUILD_PLATFORM is set
|
|
|
|
if [ -n "${DOCKER_BUILD_PLATFORM:-}" ]; then
|
2023-12-18 23:48:21 -08:00
|
|
|
DOCKER_BUILD_CMD+=("--platform=$DOCKER_BUILD_PLATFORM")
|
2023-04-06 00:34:07 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
DOCKER_BUILDKIT=1 "${DOCKER_BUILD_CMD[@]}"
|