|
|
@@ -5,8 +5,21 @@ export CONTAINERS_REGISTRIES_CONF="${CONTAINERS_REGISTRIES_CONF:-$root/tools/rem
|
|
|
pull_policy="${PROD2U_PULL_POLICY:-missing}"
|
|
|
cache_base="${PROD2U_CACHE_DIR:-/data/prod2u/cache}"
|
|
|
mkdir -p "$cache_base/apt/archives/partial"
|
|
|
+extra_args=()
|
|
|
+if [[ -n "${PROD2U_PIP_WHEELHOUSE:-}" ]]; then
|
|
|
+ if [[ ! -d "$PROD2U_PIP_WHEELHOUSE" ]]; then
|
|
|
+ echo "OFFLINE_CACHE_MISS: $PROD2U_PIP_WHEELHOUSE" >&2
|
|
|
+ exit 4
|
|
|
+ fi
|
|
|
+ extra_args+=(
|
|
|
+ --volume "$PROD2U_PIP_WHEELHOUSE:/opt/prod2u/wheelhouse:ro"
|
|
|
+ --env PIP_NO_INDEX=1
|
|
|
+ --env PIP_FIND_LINKS=/opt/prod2u/wheelhouse
|
|
|
+ )
|
|
|
+fi
|
|
|
exec podman build --pull="$pull_policy" \
|
|
|
--volume "$cache_base/apt:/var/cache/apt:rw" \
|
|
|
+ "${extra_args[@]}" \
|
|
|
--build-arg DEBIAN_MIRROR="${DEBIAN_MIRROR:-http://mirrors.aliyun.com/debian}" \
|
|
|
--build-arg DEBIAN_SECURITY_MIRROR="${DEBIAN_SECURITY_MIRROR:-http://mirrors.aliyun.com/debian-security}" \
|
|
|
--build-arg PYPI_INDEX_URL="${PYPI_INDEX_URL:-https://mirrors.aliyun.com/pypi/simple}" \
|