tpotce/docker/honeyaml/Dockerfile

24 lines
802 B
Text
Raw Normal View History

2024-10-18 19:59:29 +00:00
FROM rust:latest AS builder
#
2024-10-19 00:12:09 +00:00
RUN apt update && apt install -y git musl-tools musl-dev libzstd-dev
2024-10-18 19:59:29 +00:00
RUN update-ca-certificates
RUN git clone https://github.com/t3chn0m4g3/honeyaml /opt/honeyaml
#
WORKDIR /opt/honeyaml
2024-10-19 00:12:09 +00:00
# Need to dynamically link, otherwise multi platform builds are breaking with zstd-sys
RUN cargo build --release && \
cp target/release/honeyaml /opt/honeyaml/
2024-10-18 19:59:29 +00:00
#
2024-10-19 00:12:09 +00:00
# Using wolfi instead of ubuntu because of smaller footprint (and required full glibc support)
FROM chainguard/wolfi-base:latest
2024-10-18 19:59:29 +00:00
#
COPY --from=builder /opt/honeyaml/honeyaml /opt/honeyaml/
COPY --from=builder /opt/honeyaml/api.yml /opt/honeyaml/
#
# Setup user, groups and configs
2024-11-28 18:22:33 +00:00
RUN apk -U --no-cache add libstdc++
2024-10-18 19:59:29 +00:00
#
STOPSIGNAL SIGINT
2024-11-28 18:22:33 +00:00
USER 2000:2000
2024-10-18 19:59:29 +00:00
WORKDIR /opt/honeyaml
CMD ["./honeyaml", "-d", "/opt/honeyaml/log"]