Skip to content

Commit

Permalink
Switch Lodestar docker build to debian (#1891)
Browse files Browse the repository at this point in the history
* Switch Lodestar docker build to debian

* Fix install commands

* Replace su-exec with gosu
  • Loading branch information
nflaig authored Aug 8, 2024
1 parent af3ee4f commit 0a344ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lodestar/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ${DOCKER_REPO}:${DOCKER_TAG}
ARG BUILD_TARGET
ARG SRC_REPO

RUN apk update && apk add --no-cache ca-certificates tzdata bash su-exec git && rm -rf /var/cache/apk/*
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates tzdata bash gosu git && apt-get clean && rm -rf /var/lib/apt/lists/*

ARG USER=lsconsensus
ARG UID=10002
Expand Down
8 changes: 4 additions & 4 deletions lodestar/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22-alpine AS builder
FROM node:22.4-slim AS builder

# Here only to avoid build-time errors
ARG DOCKER_TAG
Expand All @@ -7,7 +7,7 @@ ARG DOCKER_REPO
ARG BUILD_TARGET
ARG SRC_REPO

RUN apk update && apk add --no-cache git g++ make python3 py3-setuptools bash && rm -rf /var/cache/apk/*
RUN apt-get update && apt-get install -y --no-install-recommends git g++ make python3 python3-setuptools bash && apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/app

Expand All @@ -16,9 +16,9 @@ RUN bash -c "cd .. && rm -rf app && git clone ${SRC_REPO} app && cd app && git c
&& if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:ls-pr; git checkout ls-pr; else git checkout ${BUILD_TARGET}; fi \
&& yarn install --non-interactive --frozen-lockfile && yarn build"

FROM node:22-alpine
FROM node:22.4-slim

RUN apk update && apk add --no-cache ca-certificates tzdata bash su-exec git && rm -rf /var/cache/apk/*
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates tzdata bash gosu git && apt-get clean && rm -rf /var/lib/apt/lists/*

ARG USER=lsconsensus
ARG UID=10002
Expand Down
2 changes: 1 addition & 1 deletion lodestar/docker-entrypoint-vc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -Eeuo pipefail

if [ "$(id -u)" = '0' ]; then
chown -R lsvalidator:lsvalidator /var/lib/lodestar
exec su-exec lsvalidator docker-entrypoint.sh "$@"
exec gosu lsvalidator docker-entrypoint.sh "$@"
fi

if [[ "${NETWORK}" =~ ^https?:// ]]; then
Expand Down
2 changes: 1 addition & 1 deletion lodestar/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ "$(id -u)" = '0' ]; then
chown -R lsconsensus:lsconsensus /var/lib/lodestar
exec su-exec lsconsensus docker-entrypoint.sh "$@"
exec gosu lsconsensus docker-entrypoint.sh "$@"
fi

# Remove old low-entropy token, related to Sigma Prime security audit
Expand Down

0 comments on commit 0a344ee

Please sign in to comment.