From 3830f6c52103f8b47bdbc848498fef23d540ee5a Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Thu, 6 Mar 2025 22:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86Qt=E5=88=86=E5=BC=80=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frpc.dockerfile | 30 ++++++++ ubuntu2404-qt6.dockerfile | 25 +++++++ ubuntu2404.dockerfile | 154 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 frpc.dockerfile create mode 100644 ubuntu2404-qt6.dockerfile create mode 100644 ubuntu2404.dockerfile diff --git a/frpc.dockerfile b/frpc.dockerfile new file mode 100644 index 0000000..f5706bd --- /dev/null +++ b/frpc.dockerfile @@ -0,0 +1,30 @@ +FROM amd64/alpine:3.18 + +LABEL maintainer="amass <168062547@qq.com>" + +ENV FRP_VERSION 0.61.1 + +RUN apk add openssl curl ca-certificates \ + && wget 'http://openresty.org/package/admin@openresty.com-5ea678a6.rsa.pub' \ + && mv 'admin@openresty.com-5ea678a6.rsa.pub' /etc/apk/keys/ \ + && . /etc/os-release \ + && MAJOR_VER=`echo $VERSION_ID | sed 's/\.[0-9]\+$//'` \ + && echo "http://openresty.org/package/alpine/v$MAJOR_VER/main" | tee -a /etc/apk/repositories \ + && apk update \ + && apk add openresty openresty-resty openresty-opm \ + && opm get bungle/lua-resty-session + +RUN cd /root \ + && wget --no-check-certificate -c https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz \ + && tar zxvf frp_${FRP_VERSION}_linux_amd64.tar.gz \ + && cd frp_${FRP_VERSION}_linux_amd64/ \ + && cp frpc /usr/bin/ \ + && mkdir -p /etc/frp \ + && cp frpc.toml /etc/frp \ + && cd /root \ + && rm frp_${FRP_VERSION}_linux_amd64.tar.gz \ + && rm -rf frp_${FRP_VERSION}_linux_amd64/ + +ENTRYPOINT if [ -d /app ]; then cd /app && openresty -p /app; fi; /usr/bin/frpc -c /etc/frp/frpc.toml + +# docker build --progress=tty -f frpc.dockerfile -t registry.cn-shenzhen.aliyuncs.com/amass_toolset/frpc:0.61.1 . \ No newline at end of file diff --git a/ubuntu2404-qt6.dockerfile b/ubuntu2404-qt6.dockerfile new file mode 100644 index 0000000..ae76907 --- /dev/null +++ b/ubuntu2404-qt6.dockerfile @@ -0,0 +1,25 @@ +FROM registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:24.04 + +ENV QT_VERSION=6.8.2 + +RUN cd /root \ + && apt update \ + && apt install -y libgl1-mesa-dev libfontconfig1-dev libfreetype-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev \ + && apt install -y libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavfilter-dev libavdevice-dev \ + && apt clean \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && wget https://download.qt.io/official_releases/qt/6.8/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz \ + && tar -xvf qt-everywhere-src-${QT_VERSION}.tar.xz > /dev/null \ + && cd ./qt-everywhere-src-${QT_VERSION} \ + && ./configure -prefix /opt/Qt/${QT_VERSION}/gcc_64 -opensource -debug-and-release -confirm-license -nomake examples -nomake tests -skip qtwebengine -skip qtcoap -skip qtopcua \ + && cmake --build . --parallel > /dev/null \ + && ninja install \ + && rm -fr /root/qt-everywhere-src-${QT_VERSION}* \ + && echo "export PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:$PATH" >> /etc/profile \ + && echo "export LD_LIBRARY_PATH=/opt/Qt/${QT_VERSION}/gcc_64/lib:$LD_LIBRARY_PATH" >> /etc/profile + +ENV PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:$PATH +ENV LD_LIBRARY_PATH=/opt/Qt/${QT_VERSION}/gcc_64/lib:$LD_LIBRARY_PATH + +# docker build --no-cache --progress=tty -f ubuntu2404-qt6.dockerfile -t registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:24.04-qt6.8.2 . +# docker push registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:24.04-qt6.8.2 \ No newline at end of file diff --git a/ubuntu2404.dockerfile b/ubuntu2404.dockerfile new file mode 100644 index 0000000..2aff882 --- /dev/null +++ b/ubuntu2404.dockerfile @@ -0,0 +1,154 @@ +FROM ubuntu:24.04 +LABEL maintainer="amass <168062547@qq.com>" +ENV DEBIAN_FRONTEND=noninteractive + +ENV BOOST_VERSION=1_87_0 +ENV CODE_VERSION=4.97.2 +ENV LIBDATACHANNEL_VERSION=0.22.5 +ENV NNG_VERSION=1.10.1 +ENV TCPING_VERSION=2.7.1 + +RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources \ + && apt update \ + && apt install -y gcc g++ gdb cmake ninja-build pkg-config openssh-server git nano gpg ca-certificates \ + wget curl rsync lsb-release ubuntu-keyring gnupg2 libssl-dev zlib1g-dev gettext jq bzip2 unzip xz-utils zsh htop tini \ + && install -m 0755 -d /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \ + && chmod a+r /etc/apt/keyrings/docker.asc \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \ + && wget -O - https://openresty.org/package/pubkey.gpg | gpg --dearmor -o /usr/share/keyrings/openresty.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list > /dev/null \ + && apt update \ + && apt install -y docker-ce-cli openresty \ + && apt clean \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN curl -fOL https://github.com/coder/code-server/releases/download/v$CODE_VERSION/code-server_${CODE_VERSION}_amd64.deb \ + && dpkg -i code-server_${CODE_VERSION}_amd64.deb \ + && rm code-server_${CODE_VERSION}_amd64.deb + +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" \ + && git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \ + && git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \ + && git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k \ + && sed -i 's/ZSH_THEME=".*"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' /root/.zshrc \ + && sed -i 's/plugins=(.*)/plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)/' /root/.zshrc \ + && sed -i 's/^setopt share_history/# setopt share_history/' ~/.oh-my-zsh/lib/history.zsh \ + && echo 'setopt no_share_history' >> ~/.oh-my-zsh/lib/history.zsh \ + && echo 'if [ -f /etc/profile ]; then source /etc/profile; fi' >> /etc/zsh/zprofile \ + && chsh -s /bin/zsh root + +RUN git config --global core.quotepath false \ + && git config --global user.email "168062547@qq.com" \ + && git config --global user.name "amass" + +RUN mkdir /var/run/sshd \ + && sed -i 's/#Port 22/Port 1022/' /etc/ssh/sshd_config \ + && sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config \ + && mkdir -p /root/.ssh \ + && wget https://cloud.amass.fun/s/id_ed25519/download -O /root/.ssh/authorized_keys \ + && chmod 600 /root/.ssh/authorized_keys && chown root:root /root/.ssh/authorized_keys + +EXPOSE 1022 + +RUN cd /opt \ + && git clone --depth=1 https://github.com/emscripten-core/emsdk.git \ + && cd /opt/emsdk \ + && ./emsdk install latest \ + && ./emsdk activate latest \ + && echo "export PATH=/opt/emsdk:/opt/emsdk/node/20.18.0_64bit/bin:/opt/emsdk/upstream/emscripten:$PATH" >> /etc/profile +ENV PATH=/opt/emsdk:/opt/emsdk/node/20.18.0_64bit/bin:/opt/emsdk/upstream/emscripten:$PATH + +RUN cd /root \ + && BOOST_VERSION_DOT=$(echo $BOOST_VERSION | tr '_' '.') \ + && wget https://archives.boost.io/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.gz \ + && tar xvf boost_${BOOST_VERSION}.tar.gz > /dev/null \ + && cd /root/boost_${BOOST_VERSION} \ + && ./bootstrap.sh --prefix=/opt/Libraries/boost_${BOOST_VERSION} \ + && ./b2 install -q --prefix=/opt/Libraries/boost_${BOOST_VERSION} threading=multi link=shared runtime-link=shared variant=release cxxstd=17 cxxflags=-fPIC cflags=-fPIC \ + && rm -fr /root/boost_${BOOST_VERSION}* \ + && echo "export LD_LIBRARY_PATH=/opt/Libraries/boost_${BOOST_VERSION}/lib:$LD_LIBRARY_PATH" >> /etc/profile +ENV LD_LIBRARY_PATH=/opt/Libraries/boost_${BOOST_VERSION}/lib:$LD_LIBRARY_PATH + +RUN cd /root \ + && wget https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.2/mbedtls-3.6.2.tar.bz2 \ + && tar xvf mbedtls-3.6.2.tar.bz2 \ + && cd /root/mbedtls-3.6.2 \ + && cmake -G Ninja -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/Libraries/mbedtls-3.6.2 \ + && cmake --build build --target all \ + && cmake --install build \ + && rm -fr /root/mbedtls-3.6.2* + +RUN cd /root \ + && wget https://github.com/nanomsg/nng/archive/refs/tags/v${NNG_VERSION}.tar.gz -O nng-${NNG_VERSION}.tar.gz \ + && tar xvf nng-${NNG_VERSION}.tar.gz \ + && cd /root/nng-${NNG_VERSION} \ + && sed -i 's/# PATH_SUFFIXES lib/PATH_SUFFIXES lib/' cmake/FindMbedTLS.cmake \ + && sed -i '/_MBEDTLS_LIBRARY/{n;n;n;n;s/#PATH_SUFFIXES lib/PATH_SUFFIXES lib/}' cmake/FindMbedTLS.cmake \ + && cmake -G Ninja -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/Libraries/nng-${NNG_VERSION} -DNNG_ELIDE_DEPRECATED=ON -DNNG_ENABLE_TLS=ON -DMBEDTLS_ROOT=/opt/Libraries/mbedtls-3.6.2 -D_MBEDTLS_V2_OR_NEWER=ON \ + && cmake --build build --target all \ + && cmake --install build \ + && rm -fr /root/nng-${NNG_VERSION}* + +RUN cd /root \ + && git clone --recursive --depth 1 -b v${LIBDATACHANNEL_VERSION} https://github.com/paullouisageneau/libdatachannel.git \ + && cd libdatachannel \ + && cmake -G Ninja -B build -S . -DUSE_GNUTLS=0 -DUSE_NICE=0 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/Libraries/libdatachannel-${LIBDATACHANNEL_VERSION} \ + && cmake --build build --target all \ + && cmake --install build \ + && rm -fr /root/libdatachannel + +RUN cd /root \ + && wget https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.1.0/libjpeg-turbo-3.1.0.tar.gz \ + && tar xvf libjpeg-turbo-3.1.0.tar.gz \ + && cd /root/libjpeg-turbo-3.1.0 \ + && cmake -G Ninja -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/Libraries/libjpeg-turbo-3.1.0 -DENABLE_SHARED=OFF \ + && cmake --build build --target all \ + && cmake --install build \ + && rm -fr /root/libjpeg-turbo-3.1.0* + +RUN wget https://github.com/pouriyajamshidi/tcping/releases/download/v${TCPING_VERSION}/tcping-linux-amd64-static.tar.gz -O /tmp/tcping-linux-amd64-static.tar.gz \ + && tar -xzf /tmp/tcping-linux-amd64-static.tar.gz -C /usr/bin \ + && rm /tmp/tcping-linux-amd64-static.tar.gz + +RUN cd /root \ + && wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz \ + && tar -xvf libevent-2.1.12-stable.tar.gz \ + && cd libevent-2.1.12-stable \ + && cmake -G Ninja -B build -S . -DCMAKE_INSTALL_PREFIX=/opt/Libraries/libevent-2.1.12 -DEVENT__LIBRARY_TYPE=STATIC \ + && cmake --build build --target all \ + && cmake --install build \ + && rm -fr /root/libevent-2.1.12* + +RUN cd /root \ + && wget https://github.com/coturn/coturn/archive/refs/tags/4.6.3.tar.gz -O coturn-4.6.3.tar.gz \ + && tar xvf coturn-4.6.3.tar.gz \ + && cd coturn-4.6.3 \ + && cmake -G Ninja -B build -S . -DCMAKE_INSTALL_PREFIX=/opt/Libraries/coturn-4.6.3 -DLibevent_DIR=/opt/Libraries/libevent-2.1.12/lib/cmake/libevent \ + && cmake --build build --target all \ + && cmake --install build \ + && rm -fr /root/coturn-4.6.3* + +RUN cd /root \ + && git clone --depth=1 --recursive https://github.com/ZLMediaKit/ZLMediaKit.git \ + && cd /root/ZLMediaKit \ + && apt update \ + && apt install -y libsrtp2-dev libusrsctp-dev \ + && apt clean \ + && rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && cmake -G Ninja -B build -S . -DENABLE_OPENSSL=true -DENABLE_WEBRTC=true -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/opt/Libraries/ZLMediaKit" \ + && cmake --build build --target all \ + && cmake --install build \ + && rm -fr /root/ZLMediaKit \ + && echo "export LD_LIBRARY_PATH=/opt/Libraries/ZLMediaKit/lib:$LD_LIBRARY_PATH" >> /etc/profile +ENV LD_LIBRARY_PATH=/opt/Libraries/ZLMediaKit/lib:$LD_LIBRARY_PATH + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 +ENV TERM=xterm-256color + +ENTRYPOINT ["/usr/bin/tini", "--"] +CMD ["bash", "-c", "service ssh start && code-server --bind-addr 0.0.0.0:8087"] + +# docker build --no-cache --progress=tty -f ubuntu2404.dockerfile -t registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:24.04 . +# docker push registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:24.04 \ No newline at end of file