forked from berachain/beacon-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.beacond
More file actions
64 lines (52 loc) · 1.81 KB
/
Dockerfile.beacond
File metadata and controls
64 lines (52 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Build stage
FROM golang:1.23-alpine AS builder
# Install build dependencies
RUN apk add --no-cache \
bash \
make \
git \
build-base \
gcc \
musl-dev \
ncurses
# Set up build directory
WORKDIR /beacon-kit
# Copy only necessary files for building
COPY . .
# Build the application
RUN make build
# Final stage
FROM alpine:latest
# Install minimal runtime dependencies
RUN apk add --no-cache \
make \
bash \
curl \
jq \
ncurses
# Set environment variables
ENV TESTAPP_FILES_DIR=/beacon-kit/testing/files \
JWT_PATH=/beacon-kit/testing/files/jwt.hex \
ETH_GENESIS_PATH=/beacon-kit/testing/files/eth-genesis.json \
NETHER_ETH_GENESIS_PATH=/beacon-kit/testing/files/eth-nether-genesis.json \
ETH_DATA_DIR=/beacon-kit/.tmp/eth-home \
IPC_PATH=/beacon-kit/.tmp/eth-home/eth-engine.ipc \
HTTP_URL=0.0.0.0:8551 \
IPC_PREFIX=ipc:// \
HTTP_PREFIX=http:// \
JWT_SECRET_PATH=/beacon-kit/testing/files/jwt.hex
# Create necessary directories
RUN mkdir -p /beacon-kit/testing/files /beacon-kit/.tmp/eth-home
# Copy only necessary files from builder
COPY --from=builder /beacon-kit/testing/files/entrypoint-docker.sh /beacon-kit/testing/files/
COPY --from=builder /beacon-kit/testing/files/jwt.hex /beacon-kit/testing/files/
COPY --from=builder /beacon-kit/testing/files/eth-genesis.json /beacon-kit/testing/files/
COPY --from=builder /beacon-kit/testing/files/eth-nether-genesis.json /beacon-kit/testing/files/
COPY --from=builder /beacon-kit/build/bin/beacond /bin/beacond
COPY --from=builder /beacon-kit/build/bin/beacond /beacon-kit/build/bin/beacond
# Set working directory
WORKDIR /beacon-kit
# Make entrypoint script executable
RUN chmod +x $TESTAPP_FILES_DIR/entrypoint-docker.sh
# Set the entrypoint
CMD JWT_SECRET_PATH=$JWT_PATH $TESTAPP_FILES_DIR/entrypoint-docker.sh