forked from rykcod/massa
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
54 lines (42 loc) · 1.42 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
FROM ubuntu:22.04
# LABEL about the custom image
LABEL maintainers="[email protected], [email protected]"
LABEL version=$VERSION
LABEL description="Massa node with massa-guard features"
# Build Arguments
ARG TARGETARCH
ARG VERSION
ENV VERSION=$VERSION
ENV PATH_MOUNT=/massa_mount
ENV PATH_CLIENT=/massa/massa-client
ENV PATH_NODE=/massa/massa-node
ENV PATH_NODE_CONF=/massa/massa-node/config
# Update and install packages dependencies
RUN apt-get update && apt install -y curl jq
COPY bin /massa-guard/bin
RUN if [ "$TARGETARCH" = "amd64" ]; then \
TOML_CLI_BIN="/massa-guard/bin/toml-cli"; \
else \
ARM="_arm64"; \
TOML_CLI_BIN="/massa-guard/bin/toml-cli-arm"; \
fi; \
cp $TOML_CLI_BIN /usr/bin/toml && rm -rf /massa-guard/bin; \
FILENAME="massa_${VERSION}_release_linux${ARM}.tar.gz"; \
NODE_URL="https://github.com/massalabs/massa/releases/download/${VERSION}/${FILENAME}"; \
curl -Ls -o $FILENAME $NODE_URL; \
tar -xf $FILENAME && rm $FILENAME
# Create massa-guard tree
RUN mkdir -p /massa-guard/sources
# Copy massa-guard sources
COPY massa-guard.sh /massa-guard/
COPY sources/cli.sh /cli.sh
COPY sources /massa-guard/sources
# Conf rights
RUN chmod +x /massa-guard/massa-guard.sh \
&& chmod +x /massa-guard/sources/* \
&& chmod +x /cli.sh \
&& mkdir /massa_mount
# Add Massa cli binary
RUN ln -sf /cli.sh /usr/bin/massa-cli
# Node run then massa-guard
CMD [ "/massa-guard/sources/run.sh" ]