| 12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env bash
- set -euo pipefail
- root="$(cd "$(dirname "$0")/../.." && pwd)"
- export CONTAINERS_REGISTRIES_CONF="${CONTAINERS_REGISTRIES_CONF:-$root/tools/remote/registries-cn.conf}"
- 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}" \
- -t localhost/prod2u-6400-dev:locked \
- -f "$root/containers/6400-dev/Containerfile" \
- "$root/containers/6400-dev"
|