Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use alpine as base image #1106

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +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 <[email protected]>"
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
Expand All @@ -32,12 +34,12 @@ RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release && r
COPY src ./src
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 binary into the final image
COPY --from=builder /parseable/target/release/parseable /usr/bin/parseable
COPY --from=builder /parseable/target/release/parseable /parseable

CMD ["/usr/bin/parseable"]
ENTRYPOINT ["/parseable"]
9 changes: 6 additions & 3 deletions Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
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
Expand All @@ -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

Expand Down
Loading