-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
90 lines (65 loc) · 2.84 KB
/
Dockerfile
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
# syntax=docker/dockerfile:1
# --------------------------------------------------------
# Stage 1: Build neutron-query-relayer
# --------------------------------------------------------
FROM golang:alpine3.21 AS builder
# Set up build arguments
ARG LDFLAGS
# Install dependencies for Go build and musl compatibility
RUN apk add --no-cache \
git \
gcc \
musl-dev \
libc-dev \
make
# Set up the build environment
WORKDIR /app
# Clone the neutron-query-relayer repository
RUN git clone --depth 1 https://github.com/neutron-org/neutron-query-relayer.git /app
# Download Go modules
RUN go mod download
# Build the neutron-query-relayer binary with Alpine-compatible settings
RUN go build -ldflags "${LDFLAGS}" -o build/neutron_query_relayer ./cmd/neutron_query_relayer/*.go
COPY tools /app/tools
# build the icq population tool
RUN go build -o build/icq-tool /app/tools/*.go
# --------------------------------------------------------
# Stage 3: Final image with all dependencies
# --------------------------------------------------------
FROM alpine:3.21.0
RUN apk add --no-cache file
# Install dependencies
RUN apk add --no-cache \
bash \
curl \
ca-certificates \
git \
jq
# Set the desired version of neutrond
ARG NEUTROND_VERSION="v5.0.2"
ARG NEUTROND_BINARY="neutrond-linux-amd64"
ARG NEUTROND_DOWNLOAD_URL="https://github.com/neutron-org/neutron/releases/download/${NEUTROND_VERSION}/${NEUTROND_BINARY}"
# Download and install the neutrond binary
RUN curl -L ${NEUTROND_DOWNLOAD_URL} -o /usr/local/bin/neutrond && \
chmod +x /usr/local/bin/neutrond
# Add the neutron-query-relayer binary from the builder stage
COPY --from=builder /app/build/neutron_query_relayer /usr/local/bin/neutron_query_relayer
# Add the icq-tool binary from the builder stage
COPY --from=builder /app/build/icq-tool /usr/local/bin/icq-tool
# Add CosmWasm libraries
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm.x86_64.so /lib/
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm.aarch64.so /lib/
# Copy scripts and other artifacts
COPY tools /usr/local/hydro/tools
COPY artifacts/ /usr/local/hydro/artifacts
COPY .seed /usr/local/hydro/.seed
# Set the default working directory
WORKDIR /usr/local/hydro
# Ensure scripts are executable
RUN chmod +x tools/relaying.sh tools/deployment/*.sh
# Import the seed phrase
RUN neutrond keys add submitter --recover --keyring-backend test --source /usr/local/hydro/.seed
# Expose the neutron-query-relayer port
EXPOSE 9999
# Default entry point
ENTRYPOINT ["bash"]