-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (39 loc) · 1.49 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 debian:11
LABEL org.opencontainers.image.source https://github.com/jrx-sjg/cardano-helm
ENV \
DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
ENV=/etc/profile \
USER=builder \
CNODE_HOME=/opt/cardano/ \
CARDANO_NODE_SOCKET_PATH=/opt/cardano/sockets/node0.socket
WORKDIR /
RUN apt-get update \
&& apt-get install -y xz-utils sudo vim procps --no-install-recommends
COPY ./scripts/prereqs.sh .
RUN /prereqs.sh
# SETUP Builder USER
RUN adduser --disabled-password --gecos '' builder \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& adduser builder sudo \
&& chown -R builder:builder /home/builder/.*
USER builder
WORKDIR /home/builder/
ENV PATH=/home/builder/.cabal/bin:${PATH} \
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" \
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
COPY ./cardano-node/src/bin/* .cabal/bin/
RUN sudo mkdir -p /opt/cardano/scripts \
&& sudo mkdir -p /opt/cardano/archive \
&& sudo mkdir -p /opt/cardano/sockets \
&& sudo mkdir -p /opt/cardano/logs \
&& sudo mkdir -p /opt/cardano/blocklog \
&& sudo mkdir -p /opt/cardano/files
# ENTRY SCRIPT
COPY ./docker/node/config/ /opt/cardano/files/
COPY ./docker/node/addons/cnode.sh /opt/cardano/scripts/
COPY ./docker/node/addons/banner.txt .scripts/
COPY ./docker/node/addons/entrypoint.sh .
RUN sudo chown -R builder:builder ./ /opt/cardano/* \
&& sudo chmod a+x /opt/cardano/scripts/*.sh ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]