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

support build multi arch sealer image #48

Open
wants to merge 1 commit into
base: main
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
4 changes: 2 additions & 2 deletions auto-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ if [ "$(sudo ./"${ARCH}"/bin/kubeadm config images list --config rootfs/etc/kube
sudo sed -i "s/k8s.gcr.io/sea.hub:5000/g" rootfs/etc/kubeadm.yml.tmpl
pauseImage=$(./"${ARCH}"/bin/kubeadm config images list --config "rootfs/etc/kubeadm.yml" 2>/dev/null | sed "/WARNING/d" | grep pause)
if [ -f "rootfs/etc/dump-config.toml" ]; then sudo sed -i "s/sea.hub:5000\/pause:3.6/$(echo "$pauseImage" | sed 's/\//\\\//g')/g" rootfs/etc/dump-config.toml; fi
sudo sealer build -t "docker.io/sealerio/kubernetes:${k8s_version}" -f Kubefile
sudo sealer build -t "docker.io/sealerio/kubernetes:${k8s_version}" -f Kubefile --platform "${platform}" .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where we get ${platform}?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform=$(if [[ -z "$platform" ]]; then echo "linux/arm64,linux/amd64"; else echo "$platform"; fi)

if [[ "$push" == "true" ]]; then
if [[ -n "$username" ]] && [[ -n "$password" ]]; then
sudo sealer login "$(echo "docker.io" | cut -d "/" -f1)" -u "${username}" -p "${password}"
fi
sudo sealer push "docker.io/sealerio/kubernetes:${k8s_version}"
sudo sealer alpha manifest push "docker.io/sealerio/kubernetes:${k8s_version}" --all
fi
2 changes: 1 addition & 1 deletion context/Kubefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM scratch
COPY rootfs .
COPY amd64 .
COPY ${ARCH} .
COPY imageList manifests
LABEL "cluster.alpha.sealer.io/cluster-runtime-version"="v1.22.15"
LABEL "cluster.alpha.sealer.io/cluster-runtime-type"="kubernetes"
Expand Down