2024-06-17 09:54:30 +03:00
|
|
|
FROM lukemathwalker/cargo-chef:latest-rust-1.79.0-buster AS chef
|
2021-04-20 23:53:07 +03:00
|
|
|
WORKDIR app
|
2021-11-14 01:45:50 +03:00
|
|
|
|
|
|
|
FROM chef AS planner
|
2021-04-20 23:53:07 +03:00
|
|
|
COPY . .
|
2021-11-14 01:45:50 +03:00
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
2021-04-20 23:53:07 +03:00
|
|
|
|
2021-11-14 01:45:50 +03:00
|
|
|
FROM chef AS builder
|
2022-05-09 23:09:31 +03:00
|
|
|
|
|
|
|
# Ensure working C compile setup (not installed by default in arm64 images)
|
2024-06-12 18:45:38 +03:00
|
|
|
RUN apt update && apt install build-essential -y
|
2022-05-09 23:09:31 +03:00
|
|
|
|
2021-04-20 23:53:07 +03:00
|
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
RUN cargo build --release --bin atuin
|
|
|
|
|
2024-06-13 16:35:24 +03:00
|
|
|
FROM debian:bullseye-20240612-slim AS runtime
|
2022-08-22 00:06:14 +03:00
|
|
|
|
|
|
|
RUN useradd -c 'atuin user' atuin && mkdir /config && chown atuin:atuin /config
|
2023-06-16 23:59:52 +03:00
|
|
|
# Install ca-certificates for webhooks to work
|
|
|
|
RUN apt update && apt install ca-certificates -y && rm -rf /var/lib/apt/lists/*
|
2021-04-20 23:53:07 +03:00
|
|
|
WORKDIR app
|
2021-04-21 20:13:51 +03:00
|
|
|
|
2022-08-22 00:06:14 +03:00
|
|
|
USER atuin
|
|
|
|
|
2021-04-21 20:13:51 +03:00
|
|
|
ENV TZ=Etc/UTC
|
2021-04-25 20:21:52 +03:00
|
|
|
ENV RUST_LOG=atuin::api=info
|
2021-04-21 20:13:51 +03:00
|
|
|
ENV ATUIN_CONFIG_DIR=/config
|
|
|
|
|
2021-04-20 23:53:07 +03:00
|
|
|
COPY --from=builder /app/target/release/atuin /usr/local/bin
|
|
|
|
ENTRYPOINT ["/usr/local/bin/atuin"]
|