atuin/Containerfile

41 lines
858 B
Plaintext
Raw Permalink Normal View History

2024-06-11 11:46:03 +00:00
FROM docker.io/rust:1-alpine3.20 AS builder
RUN apk --no-cache add \
git \
2024-06-11 12:03:55 +00:00
gcc \
2024-06-11 11:46:03 +00:00
protoc \
protobuf-dev \
musl-dev
ENV CARGO_CARGO_NEW_VCS="none"
ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static"
RUN echo "atuin:x:2222:2222:Linux User,,,:/atuin:/atuin" > /passwd
RUN mkdir /atuin
ENV VERSION=v18.3.0
RUN git clone https://github.com/atuinsh/atuin.git /work
WORKDIR /work
RUN git checkout $VERSION
RUN cargo build --release --target=$(arch)-unknown-linux-musl
RUN cp "./target/$(arch)-unknown-linux-musl/release/atuin" /app
FROM scratch
COPY --from=builder --chown=2222:2222 /atuin /atuin
COPY --from=builder /passwd /etc/passwd
ENV ATUIN_HOST="0.0.0.0"
ENV ATUIN_PORT=8888
2024-06-12 09:04:33 +00:00
ENV ATUIN_OPEN_REGISTRATION=false
2024-06-11 11:46:03 +00:00
ENV RUST_LOG=info,atuin_server=debug
USER atuin
COPY --from=builder /app /app
CMD ["/app", "server", "start"]
EXPOSE 8888