Skip to content

Commit 5e7974e

Browse files
committed
Refactor Dockerfile.ci for smaller sizes #1272
1 parent ac51892 commit 5e7974e

File tree

3 files changed

+36
-25
lines changed

3 files changed

+36
-25
lines changed

mithril-aggregator/Dockerfile.ci

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
# on a debian-compatible x86-64 environment
44
FROM debian:11-slim
55

6-
# Args
7-
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/8.1.2/cardano-node-8.1.2-linux.tar.gz
6+
# Create appuser
7+
RUN adduser --no-create-home --disabled-password appuser
8+
9+
# Precreate workdir
10+
RUN mkdir -p /app/bin
811

912
# Upgrade
10-
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && rm -rf /var/lib/apt/lists/*
13+
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*
1114

12-
# Create appuser
13-
RUN adduser --no-create-home --disabled-password appuser
15+
# Install cardano-cli
16+
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/8.1.2/cardano-node-8.1.2-linux.tar.gz
17+
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL \
18+
&& tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin \
19+
&& /app/bin/cardano-cli --version \
20+
&& rm -f cardano-bin.tar.gz
1421

1522
# Copy the executable
1623
COPY mithril-aggregator/mithril-aggregator /app/bin/mithril-aggregator
17-
COPY mithril-aggregator/config /app/config
1824

19-
# Install cardano-cli
20-
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL
21-
RUN tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin
22-
RUN /app/bin/cardano-cli --version
23-
RUN rm -f cardano-bin.tar.gz
25+
# Copy the config files
26+
COPY mithril-aggregator/config /app/config
2427

2528
#Workdir
2629
WORKDIR /app/

mithril-client/Dockerfile.ci

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
# on a debian-compatible x86-64 environment
44
FROM debian:11-slim
55

6-
# Upgrade
7-
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && rm -rf /var/lib/apt/lists/*
8-
96
# Create appuser
107
RUN adduser --disabled-password appuser
118

9+
# Precreate workdir
10+
RUN mkdir -p /app/bin
11+
12+
# Upgrade
13+
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*
14+
1215
# Copy the executable
1316
COPY mithril-client/mithril-client /app/bin/mithril-client
17+
18+
# Copy the config files
1419
COPY mithril-client/config /app/config
1520

1621
# Workdir

mithril-signer/Dockerfile.ci

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
# on a debian-compatible x86-64 environment
44
FROM debian:11-slim
55

6-
# Args
7-
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/8.1.2/cardano-node-8.1.2-linux.tar.gz
6+
# Create appuser
7+
RUN adduser --no-create-home --disabled-password appuser
8+
9+
# Precreate workdir
10+
RUN mkdir -p /app/bin
811

912
# Upgrade
10-
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && rm -rf /var/lib/apt/lists/*
13+
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*
1114

12-
# Create appuser
13-
RUN adduser --no-create-home --disabled-password appuser
15+
# Install cardano-cli
16+
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/8.1.2/cardano-node-8.1.2-linux.tar.gz
17+
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL \
18+
&& tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin \
19+
&& /app/bin/cardano-cli --version \
20+
&& rm -f cardano-bin.tar.gz
1421

1522
# Copy the executable
1623
COPY mithril-signer/mithril-signer /app/bin/mithril-signer
17-
COPY mithril-signer/config /app/config
1824

19-
# Install cardano-cli
20-
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL
21-
RUN tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin
22-
RUN /app/bin/cardano-cli --version
23-
RUN rm -f cardano-bin.tar.gz
25+
# Copy the config files
26+
COPY mithril-signer/config /app/config
2427

2528
# Workdir
2629
WORKDIR /app/

0 commit comments

Comments
 (0)