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

ci: simplify the script/package to speed up local development #110

Merged
merged 1 commit into from
Apr 23, 2024
Merged
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
3 changes: 3 additions & 0 deletions package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1.7.0
Copy link
Collaborator Author

@Yu-Jack Yu-Jack Apr 18, 2024

Choose a reason for hiding this comment

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

This syntax is for this error ERROR: failed to solve: failed to process “${TARGETPLATFORM#linux/}“: unsupported modifier (#) in substitution when running ./scripts/packge locally.

doc - https://docs.docker.com/reference/dockerfile/#environment-replacement


FROM registry.suse.com/bci/bci-base:15.5

ARG TARGETPLATFORM

RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \
exit 1; \
Expand Down
13 changes: 0 additions & 13 deletions scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@ cp bin/* dist/artifacts
IMAGE=${REPO}/support-bundle-kit:${TAG}
DOCKERFILE=package/Dockerfile

docker run --privileged --rm tonistiigi/binfmt --install all
buildx create --platform linux/amd64,linux/arm64 --use
buildx ls

# In old docker version, it doesn't support multiple values in --platform with --load.
# So we only load image with current platform.
# Ref: https://github.com/docker/buildx/issues/59#issuecomment-616050491

# build
buildx build --platform linux/amd64,linux/arm64 \
-f ${DOCKERFILE} -t ${IMAGE} .

# test
bk201 marked this conversation as resolved.
Show resolved Hide resolved
buildx build --load \
-f ${DOCKERFILE} -t ${IMAGE} .

Expand Down