malwaredb 0.3.1

Service for storing malicious, benign, or unknown files and related metadata and relationships.
FROM rust:1.92-slim-trixie@sha256:6cff8a33b03d328aa58d00dedda6a3c5bbee4b41e21533932bffd90d7d58f9c4 AS builder
LABEL MAINTAINER="Richard Zak <richard@malwaredb.net>"
LABEL org.opencontainers.image.authors=richard@malwaredb.net
LABEL SOURCE="https://github.com/malwaredb/malwaredb-rs"
LABEL org.opencontainers.image.source=https://github.com/malwaredb/malwaredb-rs

# Install the libmagic dev package so we can link against it, and git so the binary gets the git info for the version
RUN apt-get update && apt-get install -y libmagic-dev git

WORKDIR /malwaredb
COPY . .
COPY .git/ .

# Add `--features=admin,sqlite,vt,yara` for admin, sqlite support, VirusTotal, Yara feature(s).
# Any, some, or no features are required.
# Without the admin feature, another binary with admin is needed for initial configuration.
RUN cargo install cargo-auditable && cargo auditable build --release --features=vt,yara && cp target/release/mdb_server . && cargo clean

FROM debian:trixie-slim@sha256:4bcb9db66237237d03b55b969271728dd3d955eaaa254b9db8a3db94550b1885

RUN apt-get update && apt-get install -y libmagic1
WORKDIR /malwaredb
COPY --from=builder /malwaredb/mdb_server /malwaredb

# If running Malware DB from a config file.
# If using TLS, this is where the certificate and private key would reside.
RUN mkdir /malwaredb/config
VOLUME /malwaredb/config

# Storage for saved samples.
RUN mkdir /malwaredb/samples
VOLUME /malwaredb/samples

# Start MalwareDB
CMD ["./mdb_server"]
STOPSIGNAL SIGINT
EXPOSE 8080/tcp