Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add '-a' option to build-mic-container.sh for arch selection. #10639

Open
wants to merge 2 commits into
base: 3.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM mcr.microsoft.com/cbl-mariner/base/core:2.0
RUN tdnf update -y && \
tdnf install -y qemu-img rpm coreutils util-linux systemd openssl \
sed createrepo_c squashfs-tools cdrkit parted e2fsprogs dosfstools \
xfsprogs zstd veritysetup grub2 grub2-pc
xfsprogs zstd veritysetup grub2

COPY . /
18 changes: 15 additions & 3 deletions toolkit/tools/imagecustomizer/container/build-mic-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,30 @@ function showUsage() {
echo "usage:"
echo
echo "build-mic-container.sh \\"
echo " -t <container-tag>"
echo " -t <container-tag> \\"
echo " [-a <architecture>]"
echo
echo " Architecture can be 'amd64' or 'arm64'. Default is 'amd64'."
echo
}

while getopts ":r:n:t:" OPTIONS; do
while getopts ":a:t:" OPTIONS; do
case "${OPTIONS}" in
t ) containerTag=$OPTARG ;;
a ) ARCH=$OPTARG ;;
\? ) echo "Invalid option: -$OPTARG" >&2; showUsage; exit 1 ;;
: ) echo "Option -$OPTARG requires an argument." >&2; showUsage; exit 1 ;;
esac
done

if [[ -z $containerTag ]]; then
echo "missing required argument '-t containerTag'"
echo "missing required argument '-t <container-tag>'"
showUsage
exit 1
fi

if [[ "$ARCH" != "amd64" && "$ARCH" != "arm64" ]]; then
echo "Invalid architecture: $ARCH"
showUsage
exit 1
fi
Expand Down
Loading