-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.avian
More file actions
93 lines (78 loc) · 2.41 KB
/
Copy pathDockerfile.avian
File metadata and controls
93 lines (78 loc) · 2.41 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Avian Node Dockerfile - Builds Avian from source
FROM ubuntu:22.04 AS builder
# Install build dependencies (including depends build tools)
RUN apt-get update && apt-get install -y \
autoconf \
automake \
autotools-dev \
binutils \
bsdmainutils \
build-essential \
ca-certificates \
curl \
g++-10 \
gcc-10 \
git \
gnupg \
libtool \
pkg-config \
python3 \
rename \
xkb-data \
zip \
bison \
libssl-dev \
libevent-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-chrono-dev \
libboost-test-dev \
libboost-thread-dev \
libzmq3-dev \
&& rm -rf /var/lib/apt/lists/*
# Set GCC-10 as default
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
# Clone Avian repository
ARG AVIAN_VERSION=master
RUN git clone --branch ${AVIAN_VERSION} --depth 1 https://github.com/AvianNetwork/Avian.git /avian
WORKDIR /avian
# Build depends first (this includes BerkeleyDB)
RUN make -C depends HOST=x86_64-linux-gnu -j$(nproc)
# Build Avian using the built depends
RUN ./autogen.sh && \
CONFIG_SITE=$PWD/depends/x86_64-linux-gnu/share/config.site ./configure --disable-tests --disable-bench --without-gui --prefix=/usr/local && \
make -j$(nproc) && \
make install
# 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-chrono1.74.0 \
libboost-thread1.74.0 \
libevent-2.1-7 \
libevent-pthreads-2.1-7 \
libzmq5 \
&& rm -rf /var/lib/apt/lists/*
# Copy binaries from builder
COPY --from=builder /usr/local/bin/aviand /usr/local/bin/
COPY --from=builder /usr/local/bin/avian-cli /usr/local/bin/
# Create user
RUN useradd -m -s /bin/bash avian
# Create data directory
RUN mkdir -p /home/avian/.avian && chown -R avian:avian /home/avian
# Copy entrypoint and health check scripts
COPY entrypoint-avian.sh /usr/local/bin/entrypoint.sh
COPY health-check-avian.sh /usr/local/bin/health-check.sh
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/health-check.sh
# Switch to avian user
USER avian
WORKDIR /home/avian
# Expose ports
# RPC: 7896 (mainnet), 18766 (testnet)
# P2P: 7895 (mainnet), 18770 (testnet)
# ZMQ: 28332
EXPOSE 7896 7895 18766 18770 28332
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]