-
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
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
053a97c
add dockerfile
pm47 bf1eb0b
remove annoying git warning
pm47 5630fa0
remove lightning-kmp build and use jdk21
pm47 52febf5
more simplifications
pm47 2eb26c3
move Dockerfile to .docker
pm47 64d2226
use ubuntu instead of alpine
pm47 2a96880
fixup! use ubuntu instead of alpine
pm47 ce515f7
keep alpine image for the final image
pm47 8bb63ae
apply suggestions from @sethforprivacy
pm47 f255a11
mount /phoenix, not /phoenix/.phoenix
pm47 1c3a7ab
use branch aarch64-disable-native
pm47 feb89da
use v0.1.4 release
pm47 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Use Ubuntu image for building for compatibility with macOS arm64 builds | ||
FROM eclipse-temurin:21-jdk-jammy AS BUILD | ||
|
||
# Set necessary args and environment variables for building phoenixd | ||
ARG PHOENIXD_BRANCH=v0.1.3 | ||
ARG PHOENIXD_COMMIT_HASH=d805f81c2bfb8a09a726bb36278216e607100a16 | ||
|
||
# Upgrade all packages and install dependencies | ||
RUN apt-get update \ | ||
&& apt-get upgrade -y | ||
RUN apt-get install -y --no-install-recommends bash git \ | ||
&& apt clean | ||
|
||
# Git pull phoenixd source at specified tag/branch and compile phoenixd | ||
WORKDIR /phoenixd | ||
RUN git clone --recursive --single-branch --branch ${PHOENIXD_BRANCH} -c advice.detachedHead=false \ | ||
https://github.com/ACINQ/phoenixd . \ | ||
&& test `git rev-parse HEAD` = ${PHOENIXD_COMMIT_HASH} || exit 1 \ | ||
&& ./gradlew distTar | ||
|
||
# Alpine image to minimize final image size | ||
FROM eclipse-temurin:21-jre-alpine as FINAL | ||
|
||
# Upgrade all packages and install dependencies | ||
RUN apk update \ | ||
&& apk upgrade --no-interactive | ||
RUN apk add --update --no-cache bash | ||
|
||
# Create a phoenix group and user | ||
RUN addgroup -S phoenix -g 1000 \ | ||
&& adduser -S phoenix -G phoenix -u 1000 -h /phoenix | ||
USER phoenix | ||
pm47 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Unpack the release | ||
WORKDIR /phoenix | ||
COPY --chown=phoenix:phoenix --from=BUILD /phoenixd/build/distributions/phoenix-*-jvm.tar . | ||
RUN tar --strip-components=1 -xvf phoenix-*-jvm.tar | ||
|
||
# Indicate that the container listens on port 9740 | ||
EXPOSE 9740 | ||
pm47 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Expose default data directory as VOLUME | ||
VOLUME [ "/phoenix/.phoenix" ] | ||
pm47 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Run the daemon | ||
ENTRYPOINT ["/phoenix/bin/phoenixd", "--agree-to-terms-of-service", "--http-bind-ip", "0.0.0.0"] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: