mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-12-24 13:44:05 +00:00
chore: build with registry as cache (#454)
This commit is contained in:
parent
9b5cae49e1
commit
ef9fb79ed4
@ -1,7 +1,9 @@
|
||||
## 0.5.12-dev0
|
||||
## 0.5.12-dev1
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Use the image registry as a cache when building Docker images.
|
||||
|
||||
### Features
|
||||
|
||||
### Fixes
|
||||
|
||||
11
Makefile
11
Makefile
@ -186,24 +186,23 @@ check-coverage:
|
||||
|
||||
# Docker targets are provided for convenience only and are not required in a standard development environment
|
||||
|
||||
DOCKER_PLATFORM ?= linux/amd64
|
||||
DOCKER_IMAGE ?= unstructured-dev:latest
|
||||
DOCKER_IMAGE ?= unstructured:dev
|
||||
|
||||
.PHONY: docker-build
|
||||
docker-build:
|
||||
PIP_VERSION=${PIP_VERSION} ./scripts/docker-build.sh
|
||||
PIP_VERSION=${PIP_VERSION} DOCKER_IMAGE_NAME=${DOCKER_IMAGE} ./scripts/docker-build.sh
|
||||
|
||||
.PHONY: docker-start-bash
|
||||
docker-start-bash:
|
||||
docker run --platform $(DOCKER_PLATFORM) -ti --rm $(DOCKER_IMAGE)
|
||||
docker run -ti --rm ${DOCKER_IMAGE}
|
||||
|
||||
.PHONY: docker-test
|
||||
docker-test:
|
||||
docker run --platform $(DOCKER_PLATFORM) --rm \
|
||||
docker run --rm \
|
||||
-v ${CURRENT_DIR}/test_unstructured:/home/test_unstructured \
|
||||
$(DOCKER_IMAGE) \
|
||||
bash -c "pytest $(if $(TEST_NAME),-k $(TEST_NAME),) test_unstructured"
|
||||
|
||||
.PHONY: docker-smoke-test
|
||||
docker-smoke-test:
|
||||
./scripts/docker-smoke-test.sh
|
||||
IMAGE_NAME=${DOCKER_IMAGE} ./scripts/docker-smoke-test.sh
|
||||
|
||||
@ -1,8 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
DOCKER_REPOSITORY="${DOCKER_REPOSITORY:-quay.io/unstructured-io/unstructured}"
|
||||
PIP_VERSION="${PIP_VERSION:-22.2.1}"
|
||||
DOCKER_IMAGE_NAME="${DOCKER_IMAGE_NAME:-unstructured:dev}"
|
||||
|
||||
DOCKER_BUILDKIT=1 docker buildx build --load --platform=linux/amd64 -f Dockerfile \
|
||||
DOCKER_BUILD_CMD=(docker buildx build --load -f Dockerfile \
|
||||
--build-arg PIP_VERSION="$PIP_VERSION" \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
--progress plain \
|
||||
-t unstructured-dev:latest .
|
||||
--cache-from "$DOCKER_REPOSITORY":latest \
|
||||
-t "$DOCKER_IMAGE_NAME" .)
|
||||
|
||||
# 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[@]}"
|
||||
|
||||
@ -1 +1 @@
|
||||
__version__ = "0.5.12-dev0" # pragma: no cover
|
||||
__version__ = "0.5.12-dev1" # pragma: no cover
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user