-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (49 loc) · 1.98 KB
/
Dockerfile
File metadata and controls
65 lines (49 loc) · 1.98 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
65
FROM ubuntu:22.04 AS builder
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 \
libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev \
libboost-chrono-dev libboost-test-dev libboost-thread-dev \
libminiupnpc-dev libzmq3-dev libdb-dev libdb++-dev git \
cmake bison \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /alpha
# Copy the source code
COPY . .
# Build Dependencies and Alpha
RUN ./autogen.sh
RUN make -C depends NO_QT=1 -j$(nproc)
RUN ./configure --without-gui --prefix=$PWD/depends/x86_64-pc-linux-gnu --program-transform-name='s/bitcoin/alpha/g'
RUN make -j$(nproc)
RUN make install
# Second stage: create minimal runtime image
FROM ubuntu:22.04
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
libboost-system1.74.0 libboost-filesystem1.74.0 libboost-thread1.74.0 \
libboost-chrono1.74.0 libevent-2.1-7 libzmq5 libminiupnpc17 \
&& rm -rf /var/lib/apt/lists/*
# Update library path
RUN ldconfig /usr/local/lib
# Copy binaries from builder stage
COPY --from=builder /alpha/depends/x86_64-pc-linux-gnu/bin/alphad /usr/local/bin/
COPY --from=builder /alpha/depends/x86_64-pc-linux-gnu/bin/alpha-cli /usr/local/bin/
# Copy required libraries
COPY --from=builder /alpha/depends/x86_64-pc-linux-gnu/lib/librandomx.* /usr/local/lib/
# Configure library paths
RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf && ldconfig
# Create directory for alpha config and data
RUN mkdir -p /etc/alpha /root/.alpha
# Copy the default configuration file from the docker directory
COPY docker/alpha.conf.default /etc/alpha/alpha.conf.default
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Expose ports - P2P and RPC
EXPOSE 7933 8589
# This directory was already created above
# Set entrypoint
ENTRYPOINT ["/entrypoint.sh"]
CMD ["alphad"]