Skip to content

Commit 1f8b03d

Browse files
authored
Use ubuntu for docker runtime image (#161)
The Alpine base image causes systematic crash for some libsecp256k1 operations. JNI-related issues related to the use of `musl` instead of `glibc` are well documented. The issue is fixed by switching alpine for ubuntu, which is `glibc`-based. Note that it makes the final image significantly larger (502MB vs 313MB). The goal of using the JVM on docker was for compatibility with ARM. Once we support native ARM on Linux (#157), we could potentially move back to Alpine with native phoenixd, an even smaller footprint than before. Fixes #159.
1 parent cc98ca9 commit 1f8b03d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.docker/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ RUN git clone --recursive --single-branch --branch ${PHOENIXD_BRANCH} -c advice.
1818
&& test `git rev-parse HEAD` = ${PHOENIXD_COMMIT_HASH} || exit 1 \
1919
&& ./gradlew distTar
2020

21-
# Alpine image to minimize final image size
22-
FROM eclipse-temurin:21-jre-alpine as FINAL
21+
# JRE image to minimize final image size
22+
FROM eclipse-temurin:21-jre-jammy as FINAL
2323

2424
# Upgrade all packages and install dependencies
25-
RUN apk update \
26-
&& apk upgrade --no-interactive
27-
RUN apk add --update --no-cache bash
25+
RUN apt-get update \
26+
&& apt-get upgrade -y
27+
RUN apt-get install -y --no-install-recommends bash
2828

2929
# Create a phoenix group and user
30-
RUN addgroup -S phoenix -g 1000 \
31-
&& adduser -S phoenix -G phoenix -u 1000 -h /phoenix
30+
RUN addgroup --system phoenix --gid 1000 \
31+
&& adduser --system phoenix --ingroup phoenix --uid 1000 --home /phoenix
3232
USER phoenix
3333

3434
# Unpack the release

0 commit comments

Comments
 (0)