1 Star 0 Fork 0

李铁柱/FFmpeg-Builds

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
makeimage.sh 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
BtbN 提交于 2023-12-21 01:31 . Overhaul cache system
#!/bin/bash
set -xe
cd "$(dirname "$0")"
source util/vars.sh
TMPCFG="$(mktemp --suffix=.toml)"
cat <<EOF >"$TMPCFG"
[worker.oci]
max-parallelism = 4
EOF
trap "rm -f '$TMPCFG'" EXIT
docker buildx inspect ffbuilder &>/dev/null || docker buildx create \
--bootstrap \
--name ffbuilder \
--config "$TMPCFG" \
--driver-opt network=host \
--driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=-1 \
--driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=-1
docker container inspect ffbuildreg &>/dev/null || \
docker run --rm -d -p 127.0.0.1:64647:5000 --name ffbuildreg registry:2
LOCAL_REG_PORT="$(docker container inspect --format='{{range $p, $conf := .NetworkSettings.Ports}}{{(index $conf 0).HostPort}}{{end}}' ffbuildreg)"
LOCAL_ROOT="127.0.0.1:${LOCAL_REG_PORT}/local"
if [[ -z "$QUICKBUILD" ]]; then
if grep "FROM.*base.*" "images/base-${TARGET}/Dockerfile" >/dev/null 2>&1; then
docker buildx --builder ffbuilder build \
--cache-from=type=local,src=.cache/"${BASE_IMAGE/:/_}" \
--cache-to=type=local,mode=max,dest=.cache/"${BASE_IMAGE/:/_}" \
--push --tag "${LOCAL_ROOT}/base:latest" images/base
fi
docker buildx --builder ffbuilder build \
--cache-from=type=local,src=.cache/"${TARGET_IMAGE/:/_}" \
--cache-to=type=local,mode=max,dest=.cache/"${TARGET_IMAGE/:/_}" \
--push --tag "${LOCAL_ROOT}/base-${TARGET}:latest" \
--build-arg GH_REPO="$LOCAL_ROOT" "images/base-${TARGET}"
export REGISTRY_OVERRIDE="127.0.0.1:${LOCAL_REG_PORT}" GITHUB_REPOSITORY="local"
fi
./download.sh
./generate.sh "$TARGET" "$VARIANT" "${ADDINS[@]}"
docker buildx --builder ffbuilder build \
--cache-from=type=local,src=.cache/"${IMAGE/:/_}" \
--cache-to=type=local,mode=max,dest=.cache/"${IMAGE/:/_}" \
--load --tag "$IMAGE" .
if [[ -z "$NOCLEAN" ]]; then
docker container stop ffbuildreg
docker buildx rm -f ffbuilder
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gong_peng_peng/FFmpeg-Builds.git
git@gitee.com:gong_peng_peng/FFmpeg-Builds.git
gong_peng_peng
FFmpeg-Builds
FFmpeg-Builds
master

搜索帮助