-
-
Notifications
You must be signed in to change notification settings - Fork 101
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 different platforms for docker img #417
add different platforms for docker img #417
Conversation
tools/docker.sh
Outdated
} | ||
|
||
|
||
build_multiarch "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if building the image for multiple architectures as the only option is the best solution.
Why don't you add the regular build as the default behavior in case the user doesn't have buildx
installed or they don't pass any platform as a parameter?
build_multiarch "$@" | |
build_image "$@" |
tools/docker.sh
Outdated
check_buildx(){ | ||
if docker buildx version &>/dev/null; then | ||
return 0 | ||
fi | ||
if docker buildx ls &>/dev/null; then | ||
return 0 | ||
fi | ||
return 1 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it comes to make sure if buildx is installed I'd recommend you this:
check_buildx(){ | |
if docker buildx version &>/dev/null; then | |
return 0 | |
fi | |
if docker buildx ls &>/dev/null; then | |
return 0 | |
fi | |
return 1 | |
} | |
check_buildx(){ | |
docker buildx &>/dev/null | |
return @? | |
} |
tools/docker.sh
Outdated
} | ||
|
||
build_multiarch() { | ||
if ! check_buildx; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ! check_buildx; then | |
if check_buildx; then | |
echo "Building for platforms: $platforms" | |
# Build for each git tag and latest | |
for tag in latest $(git tag --points-at | sed s/^v//); do | |
docker buildx build \ | |
--platform "$platforms" \ | |
--tag raviqqe/muffet:$tag \ | |
--push \ | |
. | |
done | |
else | |
for tag in latest $(git tag --points-at | sed s/^v//); do | |
docker build -t raviqqe/muffet:$tag . | |
docker push raviqqe/muffet:$tag | |
done | |
fi |
@@ -23,4 +23,4 @@ jobs: | |||
with: | |||
fetch-depth: 0 | |||
- run: echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |||
- run: tools/docker.sh | |||
- run: tools/docker.sh "linux/amd64,linux/arm64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, check if the list of parameters is empty. if it is, go with the regular build.
Thank you for the changes! I didn't expect any "users" of Muffet to use |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #417 +/- ##
==========================================
- Coverage 87.50% 87.27% -0.23%
==========================================
Files 30 33 +3
Lines 872 927 +55
==========================================
+ Hits 763 809 +46
- Misses 88 94 +6
- Partials 21 24 +3 ☔ View full report in Codecov by Sentry. |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [raviqqe/muffet](https://github.com/raviqqe/muffet) | patch | `v2.10.3` -> `v2.10.6` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>raviqqe/muffet (raviqqe/muffet)</summary> ### [`v2.10.6`](https://github.com/raviqqe/muffet/releases/tag/v2.10.6) [Compare Source](raviqqe/muffet@v2.10.5...v2.10.6) #### Changelog - [`467b32d`](raviqqe/muffet@467b32d) Bump version ([#​426](raviqqe/muffet#426)) - [`9736341`](raviqqe/muffet@9736341) Push multiple tags at once ([#​425](raviqqe/muffet#425)) ### [`v2.10.5`](https://github.com/raviqqe/muffet/releases/tag/v2.10.5) [Compare Source](raviqqe/muffet@v2.10.4...v2.10.5) #### Changelog - [`2c40527`](raviqqe/muffet@2c40527) Bump version ([#​424](raviqqe/muffet#424)) - [`1ea2cb4`](raviqqe/muffet@1ea2cb4) Specify goreleaser configuration version ([#​423](raviqqe/muffet#423)) ### [`v2.10.4`](https://github.com/raviqqe/muffet/releases/tag/v2.10.4) [Compare Source](raviqqe/muffet@v2.10.3...v2.10.4) #### Changelog - [`e7b1dce`](raviqqe/muffet@e7b1dce) Build Docker image for RISC-V ([#​419](raviqqe/muffet#419)) - [`8196881`](raviqqe/muffet@8196881) Bump github.com/andybalholm/brotli from 1.1.0 to 1.1.1 ([#​415](raviqqe/muffet#415)) - [`2e3a2af`](raviqqe/muffet@2e3a2af) Bump github.com/valyala/fasthttp from 1.55.0 to 1.56.0 ([#​411](raviqqe/muffet#411)) - [`4e8bb9f`](raviqqe/muffet@4e8bb9f) Bump github.com/valyala/fasthttp from 1.56.0 to 1.57.0 ([#​416](raviqqe/muffet#416)) - [`e8e6fe3`](raviqqe/muffet@e8e6fe3) Bump golang.org/x/net from 0.29.0 to 0.30.0 ([#​414](raviqqe/muffet#414)) - [`ef0d500`](raviqqe/muffet@ef0d500) Bump version ([#​422](raviqqe/muffet#422)) - [`2f60582`](raviqqe/muffet@2f60582) Disable Windows build ([#​421](raviqqe/muffet#421)) - [`726091e`](raviqqe/muffet@726091e) Refactor Docker ([#​418](raviqqe/muffet#418)) - [`3629f2c`](raviqqe/muffet@3629f2c) Try other platforms in Docker build ([#​420](raviqqe/muffet#420)) - [`1de7e0b`](raviqqe/muffet@1de7e0b) add different platforms for docker img ([#​417](raviqqe/muffet#417)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
I saw this issue and thought that it would be great for contributing to this project.
docker.sh
and torelease.yaml