tpotce/docker/honeyaml/Dockerfile

31 lines
987 B
Text
Raw Normal View History

2024-10-18 19:59:29 +00:00
FROM rust:latest AS builder
#
2024-12-05 21:39:01 +00:00
RUN apt update && \
apt upgrade -y && \
apt install -y git \
musl-tools \
musl-dev \
libzstd-dev
2024-10-18 19:59:29 +00:00
RUN update-ca-certificates
2024-12-05 21:39:01 +00:00
RUN git clone https://github.com/t3chn0m4g3/honeyaml /opt/honeyaml && \
cd /opt/honeyaml && \
git checkout 9648c27bb31ad554ccabfdd9aeb77028219f24b0
2024-10-18 19:59:29 +00:00
#
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"]