forked from Stride-Labs/stride
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.relayer
36 lines (29 loc) · 987 Bytes
/
Dockerfile.relayer
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
# syntax = docker/dockerfile:1
FROM golang:1.18-alpine3.15 AS builder
WORKDIR /src/
ENV COMMIT_HASH=da271a9846619bebe4d8723a13c33f613da7562d
RUN apk add --update git make gcc linux-headers libc-dev eudev-dev
RUN git clone https://github.com/cosmos/relayer.git \
&& cd relayer \
&& git checkout $COMMIT_HASH \
&& make install
FROM alpine:3.15
COPY --from=builder /go/bin/rly /usr/local/bin/
RUN apk add bash vim \
&& adduser -S -h /home/relayer -D relayer -u 1000
USER relayer
WORKDIR /home/relayer
# Create startup script that takes a path as a parameter
RUN echo 'nohup rly start $1 -p events' > start.sh
# Create a script to updates the light clients so they don't expire
# Wont be necessary once https://github.com/cosmos/relayer/pull/861 is merged
RUN <<EOF cat > refresh-clients.sh
RELAY_PATHS="\$@"
while true; do
for path in \${RELAY_PATHS[@]}; do
echo "Updating \$path"
rly transact update-clients \$path
done
sleep 30
done
EOF