-
Notifications
You must be signed in to change notification settings - Fork 15
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
Issues building in Docker #1
Comments
Additionally, any specifics on expected dependencies would be helpful! It seems that gradlew tries to grab all dependencies directly asides from Java from what I could tell, but again, this is all quite outside of my wheelhouse :) |
Phoenix depends on https://github.com/ACINQ/lightning-kmp (the core lightning implementation), specifically a version that we have not yet published to public repos. You need to compile it yourself but it's easy: git clone https://github.com/ACINQ/lightning-kmp
git checkout v1.6.2-FEECREDIT-4
./gradlew publishToMavenLocal -x dokkaHtml |
Ah, thank you so much, that should be trivial to add in those commands! |
@pm47 thank you for that, was able to get further after adding that in! I have hit another issue now, though. I found that there were two unmentioned dependencies for New Dockerfile
New error:
Edit: after a bunch of searching the only related issue I could find across the interwebz was this one: ctripcorp/SQLlin#48 |
@sethforprivacy probably relate to https://stackoverflow.com/a/73481501/10854225 |
Yikes, if so I'll probably just give up on building from source in the container and pivot to downloading binaries + checking hashes + sigs. Didn't expect it would be so cumbersome to build compared to everything else I do this for. Thanks for the details, I'll close this for now and change up the approach. |
It is what I did Is it possible to leave this issue open, please? |
For some reason I can't reopen on mobile but will do so ASAP. Does that mean you have a workable solution for building in Docker you could share? |
No I do not have any solution, I use the pre-compiled binaries |
I got it working with the pre-compiled binaries as well If anyone is wondering, here is the docker image # Use a minimal Debian base image
FROM --platform=linux/amd64 debian:bullseye-slim
# Install necessary packages, including libcurl
RUN apt-get update && \
apt-get install -y wget unzip gnupg libcurl4 libcurl4-openssl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Download and import the GPG key from ACINQ's website
RUN wget -qO- https://acinq.co/pgp/drouinf.asc | gpg --import
# Download the Phoenix binary and its signatures
WORKDIR /opt/phoenix
RUN wget https://github.com/ACINQ/phoenixd/releases/download/v0.1.1/phoenix-0.1.1-linux-x64.zip && \
wget https://github.com/ACINQ/phoenixd/releases/download/v0.1.1/SHA256SUMS.asc
# Verify the release file checksums and signatures
RUN gpg -d SHA256SUMS.asc > SHA256SUMS.stripped && \
grep 'phoenix-0.1.1-linux-x64.zip' SHA256SUMS.stripped > SHA256SUMS.filtered && \
sha256sum -c SHA256SUMS.filtered
# Unzip the downloaded file
RUN unzip -j phoenix-0.1.1-linux-x64.zip && \
chmod +x phoenixd
# Clean up unnecessary files
RUN rm phoenix-0.1.1-linux-x64.zip SHA256SUMS.asc SHA256SUMS.stripped
# Indicate that the container listens on port 9740
EXPOSE 9740
# Run the daemon
ENTRYPOINT ["./phoenixd", "--http-bind-ip", "0.0.0.0"] |
Indeed the build instructions are lacking some dependencies. The dockerfile below should do what you want. However I think building native binaries on docker is not the right approach. It would be better to run on the jvm: easier build, faster runtime and compatible with linux arm64, which we don't support otherwise. We'll add a jvm build for the next version. FROM ubuntu:18.04 as build
ARG PHOENIXD_BRANCH=v0.1.1
ARG PHOENIXD_COMMIT_HASH=4e42a462e6cc7d0a09fb224820071991ac1a0eca
ARG LIGHTNING_KMP_BRANCH=v1.6.2-FEECREDIT-4
ARG LIGHTNING_KMP_COMMIT_HASH=eba5a5bf7d7d77bd59cb8e38ecd20ec72d288672
ARG CURL_VERSION=7.88.1
# Upgrade all packages and install dependencies
RUN apt-get update \
&& apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
ca-certificates \
openjdk-17-jdk \
openssh-client \
libgnutls28-dev \
libsqlite3-dev \
build-essential \
git \
wget \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set necessary args and environment variables for building phoenixd
ARG PHOENIXD_BRANCH
ARG PHOENIXD_COMMIT_HASH
ARG LIGHTNING_KMP_BRANCH
ARG LIGHTNING_KMP_COMMIT_HASH
# Build dependencies
WORKDIR /lightning-kmp
RUN git clone --recursive --branch ${LIGHTNING_KMP_BRANCH} \
https://github.com/ACINQ/lightning-kmp . \
&& test `git rev-parse HEAD` = ${LIGHTNING_KMP_COMMIT_HASH} || exit 1 \
&& ./gradlew publishToMavenLocal -x dokkaHtml
WORKDIR /curl
RUN wget https://curl.se/download/curl-${CURL_VERSION}.tar.bz2 \
&& tar -xjvf curl-${CURL_VERSION}.tar.bz2 \
&& cd curl-${CURL_VERSION} \
&& ./configure --with-gnutls=/lib/x86_64-linux-gnu/ \
&& make \
&& make install \
&& ldconfig
# Git pull phoenixd source at specified tag/branch and compile phoenixd binary
WORKDIR /phoenixd
RUN git clone --recursive --branch ${PHOENIXD_BRANCH} \
https://github.com/ACINQ/phoenixd . \
&& test `git rev-parse HEAD` = ${PHOENIXD_COMMIT_HASH} || exit 1 \
&& ./gradlew packageLinuxX64
# Indicate that the container listens on port 9740
EXPOSE 9740
# Run the daemon
ENTRYPOINT ["/phoenixd/build/bin/linuxX64/phoenixdReleaseExecutable/phoenixd.kexe", "--http-bind-ip", "0.0.0.0"] |
Thanks for the source Dockerfile. I am using this
|
The problem is not just with docker but also with arch linux @pm47 Do you think that using the library that you use inside your docker example can fix this problem? or a different libc is a problem also there? |
Thanks so much for the help with this, @pm47! I was able to use your Dockerfile as a base to build out precisely what I wanted, including a separate builder/final stage to reduce final image size greatly. For anyone interested you can find my working Dockerfile here: https://github.com/sethforprivacy/phoenixd-docker/blob/main/Dockerfile |
@vincenzopalazzo Both: it needs a recent libcurl (the exact version doesn't really matter) compiled against an old glibc 🙃 . Prebuilt binaries typically have old/old or new/new. You can use |
I think I can use nix to solve this problem @pm47 thanks :) |
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version. A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous. [1] ACINQ#1 (comment) Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version. A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous. [1] ACINQ#1 (comment) Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version. A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous. [1] ACINQ#1 (comment) Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version. A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous. [1] ACINQ#1 (comment) Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version. A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous. [1] ACINQ#1 (comment) Co-authored-by: Pavol Rusnak <pavol@rusnak.io> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version. A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous. [1] ACINQ#1 (comment) Co-authored-by: Pavol Rusnak <pavol@rusnak.io> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
As noted in [1] on Linux systems, it is not possible to build phoenixd due to a mismatch in the libc version. A possible solution is to use Nix and build phoenixd inside the shell with all the dependencies. This way, the host machine can use the binary directly without downgrading libc, which can be dangerous. [1] ACINQ#1 (comment) Co-authored-by: Pavol Rusnak <pavol@rusnak.io> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Hi there, first off thanks for this amazing tool! I can see this slotting into the toolkit of many merchants and organizations, and wanted to do what I could to simplify it's usage there.
I was working on Dockerizing it but hit a snag that is beyond my Gradle/Java knowledge. If you have any guidance on where to go next, AFAICT this should be a good base but errors out for me here:
Dockerfile:
Error:
The text was updated successfully, but these errors were encountered: