diff --git a/Dockerfile b/Dockerfile index a2e490fd2..db38137bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,23 +14,26 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # build stage -FROM rust:1.84.0-bookworm AS builder +FROM rust:1.84.0-alpine AS builder LABEL org.opencontainers.image.title="Parseable" LABEL maintainer="Parseable Team <hi@parseable.io>" LABEL org.opencontainers.image.vendor="Parseable Inc" LABEL org.opencontainers.image.licenses="AGPL-3.0" +# Install dependencies for build +RUN apk add --no-cache build-base git bash + WORKDIR /parseable COPY . . RUN cargo build --release -# final stage -FROM gcr.io/distroless/cc-debian12:latest +# Final stage as base-image +FROM scratch -WORKDIR /parseable +WORKDIR / -# Copy the static shell into base image. -COPY --from=builder /parseable/target/release/parseable /usr/bin/parseable +# Copy the static binary into the final image +COPY --from=builder /parseable/target/release/parseable /parseable -CMD ["/usr/bin/parseable"] +ENTRYPOINT ["/parseable"] diff --git a/Dockerfile.debug b/Dockerfile.debug index c58220408..89064644d 100644 --- a/Dockerfile.debug +++ b/Dockerfile.debug @@ -14,13 +14,16 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # build stage -FROM rust:1.84.0-bookworm AS builder +FROM rust:1.84.0-alpine AS builder LABEL org.opencontainers.image.title="Parseable" LABEL maintainer="Parseable Team <hi@parseable.io>" LABEL org.opencontainers.image.vendor="Parseable Inc" LABEL org.opencontainers.image.licenses="AGPL-3.0" +# Install dependencies for build +RUN apk add --no-cache build-base git bash + WORKDIR /parseable # Cache dependencies @@ -32,9 +35,9 @@ COPY src ./src RUN cargo build # final stage -FROM docker.io/debian:bookworm-slim +FROM alpine:latest -RUN apt update && apt install -y curl +RUN apk add --no-cache curl WORKDIR /parseable