You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.4 KiB
Plaintext
38 lines
1.4 KiB
Plaintext
3 years ago
|
ARG QALCULATE_VERSION=4.1.1
|
||
3 years ago
|
ARG DEBIAN_RELEASE=bullseye
|
||
|
|
||
3 years ago
|
FROM docker.io/rust:slim-${DEBIAN_RELEASE} AS builder
|
||
4 years ago
|
RUN apt-get update
|
||
3 years ago
|
RUN apt-get install -y build-essential libssl-dev libopus-dev libpq-dev pkg-config
|
||
4 years ago
|
WORKDIR /usr/src
|
||
|
RUN USER=root cargo new tobi
|
||
|
WORKDIR /usr/src/tobi
|
||
|
COPY Cargo.toml Cargo.lock ./
|
||
|
COPY src ./src
|
||
|
COPY bot-coreutils ./bot-coreutils
|
||
|
COPY bot-database ./bot-database
|
||
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||
3 years ago
|
--mount=type=cache,target=/usr/src/tobi/target \
|
||
4 years ago
|
cargo build --release
|
||
|
RUN mkdir /tmp/tobi
|
||
3 years ago
|
RUN --mount=type=cache,target=/usr/src/tobi/target cp target/release/tobi-rs /tmp/tobi/
|
||
|
|
||
|
FROM docker.io/bitnami/minideb:${DEBIAN_RELEASE} AS runtime-base
|
||
|
RUN apt update
|
||
|
RUN apt install openssl libopus0 ffmpeg python3 python3-pip libpq5 pkg-config -y
|
||
|
RUN pip3 install youtube-dl
|
||
|
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/ /var/cache
|
||
4 years ago
|
|
||
3 years ago
|
FROM docker.io/bitnami/minideb:${DEBIAN_RELEASE} AS qalculate-builder
|
||
3 years ago
|
ARG QALCULATE_VERSION
|
||
4 years ago
|
RUN mkdir /tmp/qalculate
|
||
|
WORKDIR /tmp/qalculate
|
||
|
RUN install_packages ca-certificates wget xz-utils
|
||
3 years ago
|
RUN wget https://github.com/Qalculate/qalculate-gtk/releases/download/v${QALCULATE_VERSION}/qalculate-${QALCULATE_VERSION}-x86_64.tar.xz -O qalculate.tar.xz
|
||
4 years ago
|
RUN tar xf qalculate.tar.xz
|
||
3 years ago
|
RUN cp qalculate-${QALCULATE_VERSION}/* /tmp/qalculate
|
||
4 years ago
|
|
||
3 years ago
|
FROM runtime-base
|
||
4 years ago
|
COPY --from=qalculate-builder /tmp/qalculate/* /usr/bin/
|
||
|
COPY --from=builder /tmp/tobi/tobi-rs .
|
||
4 years ago
|
ENTRYPOINT ["/tobi-rs"]
|