-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-- sort buildOne buildOne apk repo FROM alpine:3.15 img=$ns/docker-headless:compile-alpine-3.15-xx-rootfs-tiger mkdir -p /tmp/xdpyprobe run build # exit 0 without BUILDPLATFORM repo=$1 BUILDPLATFORM=linux/arm notes top PLATFORM export BUILDPLATFORM=linux/arm ls -lhaS ARG BUILDPLATFORM=linux/amd64 ARG TARGETPLATFORM sed -i "s^ARG BUILDPLATFORM=linux/amd64^ARG BUILDPLATFORM^g" Dockerfile.xx.hub \cp -a /usr/bin/upx /mnt/rootfs${targetDir}/bin/ #+upx ns=infrastlabs # it="-it" # buildx-with-cache exact sed # view,validate BUILDPLATFORM sed repo fill drops #opt>usr?? \cp -a src/xdpyprobe/* /tmp/xdpyprobe/ 共历时172秒 clear /mnt/logs # do_fontconfig gawk; 2>&1 pwd; ls -laSh tee -a $logfile print_time_cost $begin_time x4 mkdir -p func; time do_tiger |tee /mnt/logs/do_tiger.log mv down_catfile rm -rf /mnt/rootfs #clear dfile export targetDir=/opt/base; /usr tiger export targetDir=/opt/base export targetDir=/opt/base mkdir -p /tmp/upx mkdir -p / up info format up ## Build ## Built; - xdpyprobe
- Loading branch information
sam#gemmi-win10
committed
Oct 17, 2023
1 parent
e54dbaa
commit 008b1f1
Showing
6 changed files
with
239 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,75 @@ | ||
|
||
export |grep DOCKER_REG | ||
repo=registry.cn-shenzhen.aliyuncs.com | ||
echo "${DOCKER_REGISTRY_PW_infrastSubUser2}" |docker login --username=${DOCKER_REGISTRY_USER_infrastSubUser2} --password-stdin $repo | ||
|
||
img=registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15-xx | ||
docker build -t $img -f Dockerfile.xx . #xx | ||
repoHub=docker.io | ||
echo "${DOCKER_REGISTRY_PW_dockerhub}" |docker login --username=${DOCKER_REGISTRY_USER_dockerhub} --password-stdin $repoHub | ||
|
||
# ./Dockerfile: err docker-1806/1903--alpine--make--noPermition | ||
docker run -it --rm --privileged \ | ||
ns=infrastlabs | ||
tag=compile-alpine-3.15-xx | ||
img=$ns/docker-headless:$tag | ||
# BUILDPLATFORM=$1; test -z "$BUILDPLATFORM" && BUILDPLATFORM=linux/amd64 | ||
BUILDPLATFORM=linux/amd64 | ||
BUILDPLATFORM=linux/arm64 | ||
BUILDPLATFORM=linux/arm | ||
|
||
repo=$1 | ||
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 | ||
sed -i "s^ARG BUILDPLATFORM=linux/amd64^ARG BUILDPLATFORM^g" Dockerfile.xx.hub | ||
dockerfile=Dockerfile.xx.hub | ||
else | ||
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 . | ||
|
||
# exit 0 | ||
# it="-it" | ||
function buildOne(){ | ||
docker run $it --rm --privileged --platform=$BUILDPLATFORM \ | ||
-v $(pwd):/mnt \ | ||
-v $(pwd)/_build:/build \ | ||
-v $(pwd)/_tmp:/tmp \ | ||
$img sh -c "cd /mnt; sh dfile.sh" | ||
|
||
# view,validate | ||
du -sh rootfs | ||
find rootfs |sort #|grep -v xkb | ||
./rootfs/usr/bin/Xvnc -version | ||
ls -lhaS | ||
} | ||
|
||
# TODO loop: PLAT> buildOne | ||
# rootfs_plat? TODO:multiPlat可并行 | ||
# ./Dockerfile: err docker-1806/1903--alpine--make--noPermition | ||
buildOne | ||
|
||
# +Dockerfile_out | ||
dockerfile=Dockerfile.out | ||
cat > $dockerfile <<EOF | ||
FROM alpine:3.15 | ||
RUN export domain="mirrors.ustc.edu.cn"; \ | ||
echo "http://\$domain/alpine/v3.15/main" > /etc/apk/repositories; \ | ||
echo "http://\$domain/alpine/v3.15/community" >> /etc/apk/repositories | ||
ADD ./rootfs /rootfs | ||
EOF | ||
|
||
mkdir -p rootfs #test | ||
img=$ns/docker-headless:compile-alpine-3.15-xx-rootfs-tiger | ||
plat="--platform linux/amd64,linux/arm64,linux/arm" | ||
plat="--platform linux/arm" | ||
docker buildx build $cache $plat $args --push -t $img -f $dockerfile . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.