atuin/Containerfile
Sebastian Hugentobler 52f198fbf9
Some checks failed
Build Multiarch Container Image / call-reusable-workflow (push) Failing after 11m30s
try cross build with added gcc
2024-06-11 14:03:55 +02:00

41 lines
857 B
Docker

FROM docker.io/rust:1-alpine3.20 AS builder
RUN apk --no-cache add \
git \
gcc \
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
ENV ATUIN_OPEN_REGISTRATION=true
ENV RUST_LOG=info,atuin_server=debug
USER atuin
COPY --from=builder /app /app
CMD ["/app", "server", "start"]
EXPOSE 8888