-
Notifications
You must be signed in to change notification settings - Fork 14
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 official Dockerfile #17
Conversation
Will take a deeper look asap, but at first glance I love this approach! |
I'm getting "ERROR: failed to solve: eclipse-temurin:17-jre-alpine: no match for platform in manifest: not found" running on an M2 Macbook when building image. |
Try with eclipse-temurin:21-jre-alpine
Le mar. 26 mars 2024, 23:01, Tom Smith ***@***.***> a écrit :
… I'm getting "ERROR: failed to solve: eclipse-temurin:17-jre-alpine: no
match for platform in manifest: not found" running on an M2 Macbook
—
Reply to this email directly, view it on GitHub
<#17 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPPFPRMQKUBXHNBG3FGC4LY2HO2LAVCNFSM6AAAAABFJUNRIOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRGU2DKOBQGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Changed both to 21 and it seems better but now I'm getting: "ERROR: failed to solve: process "/bin/sh -c git clone --recursive --branch ${LIGHTNING_KMP_BRANCH} https://github.com/ACINQ/lightning-kmp . && test |
Rebased on master.
@tsmith123 your issue should be fixed at 5630fa0. |
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.
Building this docker image still won't work on macOS arm64 because of gradle/gradle#24875.
It could be fixed by using a glibc-based distro (ubuntu, ...) or maybe switching to a snapshot version of gradle 8.8 but I'm not sure it's worth it as macOS arm64 is not a production target (and we already publish a native phoenixd
exe for macOS arm64).
So @sstone should work on all 4 combinations linux/macos x64/arm64? More portability is better for docker I think. Besides, ubuntu 21 + jdk21 seems tailor made for a bitcoin app 😄 |
Actually went back to alpine for the final image. Best of both worlds or over the top? |
Dockerfile looks GTG to me, fantasticly simplified approach compared to building from source. I'll switch to using this as well in mine (will keep my repo just so there can be a published image in GHCR/Dockerhub) with proper credit, of course. Thanks for all of the work on this @pm47! |
I have a few other minor improvements (none necessary, just tweaks and more explicit declaration of things like user:group pairings) in my PR on my own repo here, feel free to take anything that strikes your fancy, no credit etc. necessary. |
Sorry for the message spam, but I actually just caught a breaking issue with the proposed Dockerfile. This Dockerfile doesn't properly set the file permissions for See the fix here: sethforprivacy/phoenixd-docker@f3a63e0 |
Edit: Nevermind, seems you can't build ARMv8 using ARMv8 due to Kotlin having no native aarch64 Linux support. Will find another way to distribute ARMv8 images then. |
On the contrary, it should work, that is the point of using a jvm build for docker instead of a native one. Seems like gradle tries to build the native version, which we are not going to use anyway. Will look at your other changes, feel free to suggest changes directly on this PR too! |
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.
I think this encompasses all of my minor changes/improvements, feel free to take or leave any and all of them as you see fit :)
RUN apt-get update \ | ||
&& apt-get upgrade -y | ||
RUN apt-get install -y --no-install-recommends bash git \ | ||
&& apt clean |
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.
Better apt cleanup:
&& apt clean | |
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
Co-authored-by: Seth For Privacy <[email protected]>
Building |
@sethforprivacy the build should pass on arm at 75247e4 (current master tip) |
Testing now! https://github.com/sethforprivacy/phoenixd-docker/actions/runs/8468177452/job/23200542411?pr=3 |
Builds are working on ARMv8 now! |
Co-authored-by: Seth For Privacy <[email protected]>
Looking pretty good I think. Will update branch/version after next release |
This issue was fixed in master, so next release will include the fix (per #17 (comment)). It was discussed at length above if you want more details on it! |
@tsmith123 Please confirm you are getting this error when using the Dockerfile at commit f255a11. |
I got the same error on an M1 MacBook. |
@tsmith123 @dnjooiopa Please try again at 1c3a7ab thanks! |
Great! Docker is now successfully built on my M1 Mac. |
Amazing work on this, thank you @pm47! I've merged a very similar Dockerfile with automatic builds via Github Actions, so anyone who wants to use a ready-built image for phoenixd can use it easily: https://github.com/sethforprivacy/phoenixd-docker/pkgs/container/phoenixd The latest v0.1.4 version is building now and will be available shortly. |
The Dockerfile builds on windows x86, linux x86/arm and mac x86/arm. It uses a JVM build, which is simpler and more portable than native builds. --------- Co-authored-by: Seth For Privacy <[email protected]>
Follow-up to #1.
I think building native binaries on docker is not the right approach. It's better to run on the jvm: easier build, faster runtime and compatible with linux arm64, which we don't support otherwise.
TODO:
lightning-kmp
build once Fix mempool.space ios tests lightning-kmp#622 is mergedRUN mkdir .phoenix
once Factor initialization ofdatadir
directory #15 is mergedcc @sethforprivacy