代码拉取完成,页面将自动刷新
同步操作将从 刘明野/qemu-user-static 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
set -xeo pipefail
# A POSIX variable
OPTIND=1 # Reset in case getopts has been used previously in the shell.
while getopts "d:" opt; do
case "$opt" in
d) DOCKER_REPO=$OPTARG
;;
esac
done
if [ "${DOCKER_REPO}" = "" ]; then
echo "DOCKER_REPO is required." 1>&2
exit 1
fi
# Test cases
# ------------------------------------------------
# multiarch/qemu-user-static image
# It should register binfmt_misc entry with 'flags: F'
# by given "-p yes" option.
sudo docker run --rm --privileged ${DOCKER_REPO} --reset -p yes
cat /proc/sys/fs/binfmt_misc/qemu-aarch64
grep -q '^flags: F$' /proc/sys/fs/binfmt_misc/qemu-aarch64
# It should output the result of "uname -m".
docker pull arm64v8/ubuntu
docker run --rm -t arm64v8/ubuntu uname -m
# It should install a package.
docker build --rm -t "test/latest/ubuntu" -<<EOF
FROM arm64v8/ubuntu
RUN apt-get update && \
apt-get -y install gcc
EOF
# It should output the result of "uname -m".
docker pull arm64v8/fedora
docker run --rm -t arm64v8/fedora uname -m
# It should install a package.
# TODO: Comment out as it takes a time.
# docker build --rm -t "test/latest/fedora" -<<EOF
# FROM arm64v8/fedora
# RUN dnf -y upgrade && \
# dnf -y install gcc
# EOF
# ------------------------------------------------
# multiarch/qemu-user-static:register image
# It should register binfmt_misc entry with 'flags: '
# by given no "-p yes" option.
sudo docker run --rm --privileged ${DOCKER_REPO}:register --reset
cat /proc/sys/fs/binfmt_misc/qemu-aarch64
grep -q '^flags: $' /proc/sys/fs/binfmt_misc/qemu-aarch64
# ------------------------------------------------
# multiarch/qemu-user-static:$to_arch image
# multiarch/qemu-user-static:$from_arch-$to_arch image
# /usr/bin/qemu-aarch64-static should be included.
docker run --rm -t ${DOCKER_REPO}:aarch64 /usr/bin/qemu-aarch64-static --version
docker run --rm -t ${DOCKER_REPO}:x86_64-aarch64 /usr/bin/qemu-aarch64-static --version
# ------------------------------------------------
# Integration test
docker build --rm -t "test/integration/ubuntu" -<<EOF
FROM ${DOCKER_REPO}:x86_64-aarch64 as qemu
FROM arm64v8/ubuntu
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
EOF
docker run --rm -t "test/integration/ubuntu" uname -m
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。