-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile.ci
44 lines (35 loc) · 1.48 KB
/
Dockerfile.ci
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
# Creates a docker image to run an executable built outside of the image
# This relies on the fact the mithril-signer executable has been built
# on a debian-compatible x86-64 environment
ARG DOCKER_IMAGE_FROM=debian:11-slim
FROM $DOCKER_IMAGE_FROM
# Create appuser
RUN adduser --no-create-home --disabled-password appuser
# Precreate workdir
RUN mkdir -p /app/bin
# Upgrade
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*
# Install cardano-cli
ARG CARDANO_NODE_VERSION=10.1.2
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz
ARG EMBED-CARDANO-CLI=0
# Install cardano-cli
RUN if [ "$EMBED-CARDANO-CLI" = 1 ] ; then \
wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL \
&& mkdir -p /app/bin \
&& (tar xzf cardano-bin.tar.gz ./bin/cardano-cli && mv /bin/cardano-cli /app/bin) || (tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin) \
&& /app/bin/cardano-cli --version \
&& rm -f cardano-bin.tar.gz \
&& chmod a+x /app/bin/cardano-cli; \
fi
# Copy the executable
COPY mithril-signer/mithril-signer /app/bin/mithril-signer
# Copy the config files
COPY mithril-signer/config /app/config
# Workdir
WORKDIR /app/
RUN chown -R appuser /app/ && chmod a+x /app/bin/mithril-signer
# Use an unprivileged user
USER appuser
# Run the executable
ENTRYPOINT ["/app/bin/mithril-signer","-vv"]