Skip to content

Commit

Permalink
simplify dockerfiles (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19-cw authored Jun 25, 2024
1 parent 1e8517f commit a97bc12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.run_relayer
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ WORKDIR /app
COPY --from=builder /app/target/release/relayer /app/relayer
COPY --from=builder /app/config/* /app/config/

CMD ["sh", "-c", "/app/relayer"]
CMD sh -c /app/relayer
4 changes: 2 additions & 2 deletions docker/Dockerfile.run_stratus
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ENV CARGO_PROFILE_RELEASE_DEBUG=1
ENV LOG_FORMAT=json
ENV NO_COLOR=1

RUN cargo build --release --bin stratus --features metrics,kubernetes
RUN cargo build --release --bin stratus --features kubernetes


# Runtime
Expand All @@ -28,4 +28,4 @@ WORKDIR /app
COPY --from=builder /app/target/release/stratus /app/stratus
COPY --from=builder /app/config/* /app/config/

CMD ["sh", "-c", "tail --follow=name --retry data/rocksdb/LOG & /app/stratus"]
CMD sh -c "tail --follow=name --retry data/rocksdb/LOG & /app/stratus"
4 changes: 2 additions & 2 deletions docker/Dockerfile.run_with_importer
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ ENV CARGO_PROFILE_RELEASE_DEBUG=1
ENV LOG_FORMAT=json
ENV NO_COLOR=1

RUN cargo build --release --bin run-with-importer --features metrics,rocks,kubernetes
RUN cargo build --release --bin run-with-importer --features kubernetes

# Runtime
FROM rust:1.75 as runtime
WORKDIR /app
COPY --from=builder /app/target/release/run-with-importer /app/run-with-importer
COPY --from=builder /app/config/* /app/config/

CMD ["sh", "-c", "tail --follow=name --retry data/rocksdb/LOG & /app/run-with-importer"]
CMD sh -c "tail --follow=name --retry data/rocksdb/LOG & /app/run-with-importer"
6 changes: 3 additions & 3 deletions docker/Dockerfile.run_with_importer_cached
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN mkdir src && echo "fn main() {}" > src/main.rs
# This layer caches dependencies
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release --bin run-with-importer --features metrics,rocks || true
cargo build --release --bin run-with-importer || true

# Remove the dummy main.rs
RUN rm -rf src
Expand All @@ -42,12 +42,12 @@ ENV NO_COLOR=1
ENV ENABLE_TEST_ACCOUNTS=1
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release --bin run-with-importer --features metrics,rocks,dev
cargo build --release --bin run-with-importer --features dev

# Runtime
FROM rust:1.75 as runtime
WORKDIR /app
COPY --from=builder /app/target/release/run-with-importer /app/run-with-importer
COPY --from=builder /app/config/* /app/config/

CMD ["sh", "-c", "/app/run-with-importer"]
CMD sh -c /app/run-with-importer

0 comments on commit a97bc12

Please sign in to comment.