Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert Dockerfile
Browse files Browse the repository at this point in the history
alnoki committed Nov 18, 2024
1 parent 72b12d8 commit d255c38
Showing 1 changed file with 48 additions and 2 deletions.
50 changes: 48 additions & 2 deletions src/rust/broker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
FROM alpine
ARG BUILDER_VERSION=1.0.0

# Configure base image with buildtime dependencies.
FROM econialabs/rust-builder:$BUILDER_VERSION AS base
WORKDIR /app
RUN mkdir foo

# Prepare build recipe.
FROM base AS planner
COPY . .
RUN cargo chef prepare --bin broker

# Cache build dependencies, compile binary.
FROM base AS builder
ARG FEATURES
RUN apt-get update && apt-get install -y --no-install-recommends \
libudev-dev=252.* \
build-essential=12.* \
libclang-dev=1:14.* \
libpq-dev=15.* \
libssl-dev=3.* \
libdw-dev=0.188-2.1 \
pkg-config=1.8.* \
lld=1:14.* \
&& rm -rf /var/lib/apt/lists/*
COPY --from=planner app/recipe.json recipe.json
RUN ls -la
COPY processor processor
RUN cargo chef cook \
--bin broker \
--features $FEATURES \
--package broker \
--release
COPY . .
RUN cargo build --bin broker --package broker --release --features $FEATURES

# Install runtime dependencies, copy over binary.
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
curl=7.* \
libssl-dev=3.* \
libpq-dev=15.* \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir app
COPY --from=builder /app/target/release/broker /app

# This helps the container stop faster.
STOPSIGNAL SIGKILL

ENTRYPOINT ["/app/broker"]

0 comments on commit d255c38

Please sign in to comment.