@@ -18,22 +18,21 @@ RUN adduser --no-create-home --disabled-password appuser
18
18
WORKDIR /app
19
19
20
20
# Copy local dependencies
21
- COPY mithril-stm/ /mithril-stm/
22
- COPY Cargo.lock /mithril-stm/
23
- COPY mithril-common/ /mithril-common/
24
- COPY Cargo.lock /mithril-common/
21
+ COPY . .
25
22
26
23
# Build the app using a dummy main in order to cache dependencies
27
- COPY mithril-aggregator/Cargo.toml /app
28
- COPY Cargo.lock /app/
29
- RUN mkdir -p /app/src/ && echo "fn main () {}" > /app/src/main.rs
30
- RUN cargo build --release -- manifest-path /app/Cargo.toml
24
+ RUN mv /app/ mithril-aggregator /app/mithril-aggregator.1 && mkdir -p /app/mithril-aggregator/src
25
+ COPY mithril-aggregator/ Cargo.toml /app/mithril-aggregator /
26
+ RUN echo "fn main () {}" > /app/mithril-aggregator /src/main.rs
27
+ RUN cargo build --release -p mithril-aggregator -- manifest-path /app/mithril-aggregator /Cargo.toml
31
28
32
- # Copy the rest of the files into the container
33
- COPY ./mithril-aggregator /app/
29
+ # Rollback the rest of the files into the container
30
+ RUN rm -rf /app/mithril-aggregator && mv /app/mithril-aggregator.1 /app/mithril-aggregator
31
+ COPY ./mithril-aggregator/src/main.rs /app/mithril-aggregator/src/
34
32
35
33
# Build the binary
36
- RUN cargo build --release
34
+ RUN cargo build --release -p mithril-aggregator
35
+ RUN /app/target/release/mithril-aggregator --version
37
36
38
37
# ##############################
39
38
# STEP 2: build a small image
@@ -50,14 +49,14 @@ COPY --from=rustbuilder /etc/passwd /etc/passwd
50
49
COPY --from=rustbuilder /app/target/release/mithril-aggregator /app/bin/mithril-aggregator
51
50
52
51
# Copy the config files
53
- COPY --from=rustbuilder /app/config /app/config
52
+ COPY --from=rustbuilder /app/mithril-aggregator/ config /app/config
54
53
55
54
# Workdir
56
55
WORKDIR /app/
57
56
RUN chown -R appuser /app/
58
57
59
58
# Install cardano-cli
60
- RUN wget -nv -O cardano-bin.tar.gz https://update-cardano-mainnet.iohk.io/cardano-node-releases/cardano-node-1.35.4 -linux.tar.gz
59
+ RUN wget -nv -O cardano-bin.tar.gz https://update-cardano-mainnet.iohk.io/cardano-node-releases/cardano-node-1.35.5 -linux.tar.gz
61
60
RUN tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin
62
61
RUN /app/bin/cardano-cli --version
63
62
RUN rm -f cardano-bin.tar.gz
0 commit comments