30 lines
764 B
Docker
30 lines
764 B
Docker
FROM debian:stable-slim AS builder
|
|
|
|
RUN apt-get update && apt-get install -yqq --no-install-recommends \
|
|
build-essential \
|
|
curl \
|
|
ca-certificates \
|
|
pkg-config \
|
|
libssl-dev \
|
|
git
|
|
|
|
RUN curl -sSL https://sh.rustup.rs | bash -s -- -y --default-toolchain nightly
|
|
|
|
COPY . /src
|
|
|
|
RUN cd /src && bash -c '. $HOME/.cargo/env; cargo build --release' && \
|
|
mkdir -p /target/usr/local/bin && cp /src/target/release/nyuukyou /target/usr/local/bin/nyuukyou
|
|
|
|
FROM debian:stable-slim
|
|
|
|
COPY --from=builder /target/ /
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -yqq --no-install-recommends openssl curl ca-certificates && \
|
|
useradd -m -u 1000 -r nyuukyou && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
USER nyuukyou
|
|
|
|
ENTRYPOINT [ "/usr/local/bin/nyuukyou" ]
|
|
|