bot (latest)

Published 2024-12-18 01:14:34 +00:00 by eta357 in LibreTunes/Bot

Installation

docker pull gitea.mregirouard.com/libretunes/bot:latest
sha256:fc2f8fc07e2413eb8e4bb3a0604d6969409a03883892add8456c4f7016f7da90

About this package

Docker environment for building musl based static linux rust binaries

Image Layers

ARG RELEASE
ARG LAUNCHPAD_BUILD_ARCH
LABEL org.opencontainers.image.ref.name=ubuntu
LABEL org.opencontainers.image.version=22.04
ADD file:ebe009f86035c175ba244badd298a2582914415cf62783d510eab3a311a5d4e1 in /
CMD ["/bin/bash"]
LABEL maintainer=Eirik Albrigtsen <sszynrae@gmail.com>
RUN /bin/sh -c apt-get update && apt-get install -y musl-dev musl-tools file git openssh-client make cmake g++ curl pkgconf ca-certificates xutils-dev libssl-dev libpq-dev automake autoconf libtool libprotobuf-dev unzip --no-install-recommends && rm -rf /var/lib/apt/lists/* # buildkit
ARG CHANNEL=nightly
ENV RUSTUP_VER=1.27.1 RUST_ARCH=x86_64-unknown-linux-gnu CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN |1 CHANNEL=nightly /bin/sh -c curl "https://static.rust-lang.org/rustup/archive/${RUSTUP_VER}/${RUST_ARCH}/rustup-init" -o rustup-init && chmod +x rustup-init && ./rustup-init -y --default-toolchain ${CHANNEL} --profile minimal --no-modify-path && rm rustup-init && ~/.cargo/bin/rustup target add x86_64-unknown-linux-musl # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c chmod a+X /root # buildkit
ENV SSL_VER=1.1.1w CURL_VER=8.7.1 ZLIB_VER=1.3.1 PQ_VER=11.12 SQLITE_VER=3450300 PROTOBUF_VER=25.3 SCCACHE_VER=0.8.0 CC=musl-gcc PREFIX=/musl PATH=/usr/local/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LD_LIBRARY_PATH=
RUN |1 CHANNEL=nightly /bin/sh -c cd /tmp && curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VER}/protoc-${PROTOBUF_VER}-linux-x86_64.zip -o protoc.zip && unzip protoc.zip && cp bin/protoc /usr/bin/protoc && rm -rf * # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c curl -sSL https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VER}/sccache-v${SCCACHE_VER}-x86_64-unknown-linux-musl.tar.gz | tar xz && mv sccache-v${SCCACHE_VER}-*-unknown-linux-musl/sccache /usr/local/bin/ && chmod +x /usr/local/bin/sccache && rm -rf sccache-v${SCCACHE_VER}-*-unknown-linux-musl # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c mkdir $PREFIX && echo "$PREFIX/lib" >> /etc/ld-musl-x86_64.path && ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm && ln -s /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic && ln -s /usr/include/linux /usr/include/x86_64-linux-musl/linux # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c curl -sSL https://zlib.net/zlib-$ZLIB_VER.tar.gz | tar xz && cd zlib-$ZLIB_VER && CC="musl-gcc -fPIC -pie" LDFLAGS="-L$PREFIX/lib" CFLAGS="-I$PREFIX/include" ./configure --static --prefix=$PREFIX && make -j$(nproc) && make install && cd .. && rm -rf zlib-$ZLIB_VER # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c curl -sSL https://www.openssl.org/source/openssl-$SSL_VER.tar.gz | tar xz && cd openssl-$SSL_VER && ./Configure no-zlib no-shared -fPIC --prefix=$PREFIX --openssldir=$PREFIX/ssl linux-x86_64 && env C_INCLUDE_PATH=$PREFIX/include make depend 2> /dev/null && make -j$(nproc) && make all install_sw && cd .. && rm -rf openssl-$SSL_VER # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c curl -sSL https://curl.se/download/curl-$CURL_VER.tar.gz | tar xz && cd curl-$CURL_VER && CC="musl-gcc -fPIC -pie" LDFLAGS="-L$PREFIX/lib" CFLAGS="-I$PREFIX/include" ./configure --enable-shared=no --with-zlib --enable-static=ssl --enable-optimize --prefix=$PREFIX --with-ca-path=/etc/ssl/certs/ --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt --without-ca-fallback --with-openssl --without-libpsl && make -j$(nproc) curl_LDFLAGS="-all-static" && make install && cd .. && rm -rf curl-$CURL_VER # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c curl -sSL https://ftp.postgresql.org/pub/source/v$PQ_VER/postgresql-$PQ_VER.tar.gz | tar xz && cd postgresql-$PQ_VER && CC="musl-gcc -fPIE -pie" LDFLAGS="-L$PREFIX/lib" CFLAGS="-I$PREFIX/include" ./configure --without-readline --with-openssl --prefix=$PREFIX --host=x86_64-unknown-linux-musl && cd src/interfaces/libpq make -s -j$(nproc) all-static-lib && make -s install install-lib-static && cd ../../bin/pg_config && make -j $(nproc) && make install && cd .. && rm -rf postgresql-$PQ_VER # buildkit
RUN |1 CHANNEL=nightly /bin/sh -c curl -sSL https://www.sqlite.org/2024/sqlite-autoconf-$SQLITE_VER.tar.gz | tar xz && cd sqlite-autoconf-$SQLITE_VER && CFLAGS="-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_RTREE -DSQLITE_USE_URI -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1" CC="musl-gcc -fPIC -pie" ./configure --prefix=$PREFIX --host=x86_64-unknown-linux-musl --enable-threadsafe --enable-dynamic-extensions --disable-shared && make && make install && cd .. && rm -rf sqlite-autoconf-$SQLITE_VER # buildkit
ENV PATH=/root/.cargo/bin:/musl/bin:/usr/local/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUSTUP_HOME=/root/.rustup CARGO_BUILD_TARGET=x86_64-unknown-linux-musl PKG_CONFIG_ALLOW_CROSS=true PKG_CONFIG_ALL_STATIC=true PQ_LIB_STATIC_X86_64_UNKNOWN_LINUX_MUSL=true PKG_CONFIG_PATH=/musl/lib/pkgconfig PG_CONFIG_X86_64_UNKNOWN_LINUX_GNU=/usr/bin/pg_config OPENSSL_STATIC=true OPENSSL_DIR=/musl SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt SSL_CERT_DIR=/etc/ssl/certs LIBZ_SYS_STATIC=1 DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC
WORKDIR /volume
WORKDIR /app
RUN /bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends pkg-config openssl clang && rm -rf /var/lib/apt/lists/* # buildkit
COPY Cargo.toml Cargo.lock /app/ # buildkit
RUN /bin/sh -c mkdir /app/src && echo "fn main() {}" > /app/src/main.rs # buildkit
COPY teatime /app/teatime # buildkit
RUN /bin/sh -c cargo build --release --target=x86_64-unknown-linux-musl # buildkit
RUN /bin/sh -c rm -rf /app/src # buildkit
COPY src /app/src # buildkit
RUN /bin/sh -c touch /app/src/main.rs # buildkit
RUN /bin/sh -c cargo build --release --target=x86_64-unknown-linux-musl # buildkit
EXPOSE map[8000/tcp:{}]
ENTRYPOINT ["/app/target/x86_64-unknown-linux-musl/release/libretunes-gitea-bot"]

Labels

Key Value
maintainer Eirik Albrigtsen <sszynrae@gmail.com>
org.opencontainers.image.created 2024-12-17T10:18:03.810Z
org.opencontainers.image.description Docker environment for building musl based static linux rust binaries
org.opencontainers.image.licenses MIT
org.opencontainers.image.ref.name ubuntu
org.opencontainers.image.revision 27c5aebcbc29c045a45bd136df3692b1e5108129
org.opencontainers.image.source https://github.com/clux/muslrust
org.opencontainers.image.title muslrust
org.opencontainers.image.url https://github.com/clux/muslrust
org.opencontainers.image.version nightly
Details
Container
2024-12-18 01:14:34 +00:00
6
OCI / Docker
linux/amd64
MIT
881 MiB
Versions (1) View all
latest 2024-12-18