Skip to content

Commit

Permalink
# buildx-with-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sam#gemmi-win10 committed Oct 17, 2023
1 parent dd99f3a commit f07687b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions ubt-core/src/gcc/static/alpine-build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@

img=registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15-xx
tag=compile-alpine-3.15-xx
img=infrastlabs/docker-headless:$tag
BUILDPLATFORM=$1; test -z "$BUILDPLATFORM" && BUILDPLATFORM=linux/amd64
repo=$2
if [ "" != "$repo" ]; then
cat Dockerfile.xx > Dockerfile.xx.hub
sed -i "s^registry.cn-shenzhen.aliyuncs.com/infrasync/alpine^alpine^g" Dockerfile.xx.hub
sed -i "s^registry.cn-shenzhen.aliyuncs.com/infrasync/tonistiigi-xx^tonistiigi/xx^g" Dockerfile.xx.hub
docker build -t $img -f Dockerfile.xx.hub . #xx
dockerfile=Dockerfile.xx.hub
else
docker build -t $img -f Dockerfile.xx . #xx
dockerfile=Dockerfile.xx
fi

# buildimg
# docker build -t $img -f $dockerfile . #xx
# buildx-with-cache
# cache
ali="registry.cn-shenzhen.aliyuncs.com"
cimg="docker-headless-cache:$tag"
cache="--cache-from type=registry,ref=$ali/$ns/$cimg --cache-to type=registry,ref=$ali/$ns/$cimg"
#
plat="--platform linux/amd64,linux/arm64,linux/arm"
# plat="--platform linux/arm"
docker buildx build $cache $plat $args --push -t $img -f $dockerfile .

# ./Dockerfile: err docker-1806/1903--alpine--make--noPermition
docker run -it --rm --privileged --platform=$BUILDPLATFORM \
-v $(pwd):/mnt \
Expand Down

0 comments on commit f07687b

Please sign in to comment.