tcpasters/oci/Containerfile.pasted
Thorsten Schubert 762bf9ed8e
All checks were successful
continuous-integration/drone/push Build is passing
OCI compatible container configuration
2022-09-17 10:03:52 +02:00

40 lines
1,023 B
Docker

# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright © 2022 Thorsten Schubert <tschubert@bafh.org>
FROM docker.io/rustlang/rust:nightly-bullseye-slim as builder
WORKDIR /usr/src
COPY . .
RUN rm -rf -- .cargo; \
cargo --color never build --workspace --target x86_64-unknown-linux-gnu --release
FROM debian:bullseye-slim AS tcp-pasted
ARG TARGET=/usr/src/target/x86_64-unknown-linux-gnu/release/
ARG PUID=1000
ARG PGID=1000
ENV DEBIAN_FRONTEND=noninteractive
ENV USER pasted
COPY --from=builder \
${TARGET}/tcp-pasted \
${TARGET}/tcp-erased \
${TARGET}/tcp-expire \
${TARGET}/tcp-filter-cli \
${TARGET}/tcp-filter-hasher \
${TARGET}/tcp-filter-nude \
/usr/local/bin/
RUN addgroup --system --gid ${PGID} pasted && \
adduser --system --no-create-home --disabled-password --home /var/lib/pasted --shell /bin/sh --uid ${PUID} --gid ${PGID} pasted
USER pasted
VOLUME /var/lib/pasted
WORKDIR /var/lib/pasted
CMD ["/bin/bash"]
# vi: set ft=dockerfile ts=2 sw=2 sts=0 nosr et si tw=0 fdm=manual: