-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (44 loc) · 1.71 KB
/
Copy pathDockerfile
File metadata and controls
53 lines (44 loc) · 1.71 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
# Dockerfile for Lotus execution node (Ubuntu-based)
#
# This container runs the lotus daemon, which is the execution node for
# the Filecoin network, handling FEVM and FVM.
#
# Note: Using Ubuntu 24.04 because lotus binaries are dynamically linked
# against glibc 2.38/2.39 which is available in Ubuntu 24.04.
FROM ubuntu:24.04
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
bash \
jq \
curl \
libhwloc-dev \
&& rm -rf /var/lib/apt/lists/*
# Create foc-user and foc-group with matching host UID/GID when it is run. The 1002 below is just a placeholder which will be replaced during build process. See `docker.rs`
ARG USER_ID=1002
ARG GROUP_ID=1002
RUN userdel ubuntu || true
RUN groupadd -g ${GROUP_ID} foc-group && \
useradd -l -u ${USER_ID} -g foc-group -m -s /bin/bash foc-user
# Create necessary directories with proper ownership
RUN mkdir -p /var/tmp/filecoin-proof-parameters \
&& mkdir -p /home/foc-user/.lotus-local-net \
&& mkdir -p /home/foc-user/.genesis \
&& chown -R foc-user:foc-group /var/tmp/filecoin-proof-parameters \
&& chown -R foc-user:foc-group /home/foc-user
# Switch to foc-user
USER foc-user
# Copy the lotus binary from the host (will be mounted)
# Binary will be mounted from ~/.foc-localnet/bin
# Expose lotus daemon ports
# 1234 - Lotus API
# 1235 - Lotus P2P
EXPOSE 1234 1235
# Set environment variables for local devnet
ENV LOTUS_PATH=/home/foc-user/.lotus-local-net
ENV LOTUS_SKIP_GENESIS_CHECK=_yes_
ENV FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters
ENV CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
ENV CGO_CFLAGS="-D__BLST_PORTABLE__"
# Default command will be overridden when container starts
CMD ["/bin/bash"]