Compare commits

...

54 Commits

Author SHA1 Message Date
xiao
6b23729727 fix: 修复健康检查命令以支持 HTTPS 2024-12-21 09:21:29 +08:00
cnb.ZYsjO8G6wGA
5333085e82 chore: 更新 Dockerfile 以安装 cronie 包 2024-12-05 15:53:31 +08:00
cnb.ZYsjO8G6wGA
a2d3171ef5 chore: 更新 bt.sh 脚本以增强系统安全和功能
在 bt.sh 脚本中,已进行以下修改:
1. 将 `/sbin/crond` 更新为 `/usr/sbin/crond`,以确保使用正确的 crond 路径。
2. 新增 `ssh-keygen -A` 命令,用于生成 SSH 密钥对,增强系统安全性。
这些修改旨在提升脚本的稳定性和安全性。
2024-12-05 15:52:49 +08:00
xiao
abe653212f chore: 更新 Dockerfile 以安装 Perl 及其开发库 2024-12-05 10:10:51 +08:00
xiao
0d9f339f35 chore: 更新 init_mysql 函数中的平台判断和脚本执行方式 2024-12-05 09:32:45 +08:00
xiao
d03eaffe42 删除文件 phpmyadmin.sh 2024-12-05 09:12:59 +08:00
xiao
72653d4be5 chore: 移除未使用的依赖包以减小镜像大小 2024-12-05 09:04:11 +08:00
xiao
c84997026d chore: 优化 Dockerfile 配置和脚本执行顺序 2024-12-04 21:55:08 +08:00
xiao
9bcfad0700 style: 更新 Dockerfile 中的依赖安装命令 2024-12-04 21:08:18 +08:00
xiao
e87b6c1dd3 chore: 更新 Dockerfile 依赖包列表 2024-12-04 21:01:23 +08:00
xiao
6282d2afca chore: 更新 util-linux 依赖包 2024-12-04 20:54:27 +08:00
xiao
895b5ef49b refactor: 简化 Dockerfile 中的 yum 源切换和包管理命令 2024-12-04 20:39:33 +08:00
xiao
ea6bddabf3 refactor: 简化 Dockerfile 中的镜像源切换和依赖安装脚本 2024-12-04 20:38:00 +08:00
xiao
7ddeba3153 chore: 更新 Dockerfile 中的 rockylinux 镜像源为腾讯云源并优化代码格式 2024-12-04 20:35:04 +08:00
xiao
a3342d156e feat: 添加随机主机名设置
在 Dockerfile 中添加了设置随机主机名的功能,通过构建参数 RANDOM_NAME 来指定一个随机主机名。
2024-12-04 20:21:39 +08:00
xiao
28e1e6c031 chore: 移除不必要的依赖安装命令
移除了安装 'Development Tools' 和 'glibc-locale-source' 的命令,因为它们在后续步骤中被重复安装或不必要。
2024-12-04 20:12:35 +08:00
xiao
1d0fbf4214 chore: 更新 Dockerfile 中的基础镜像和依赖包
将基础镜像从 rockylinux
2024-12-04 20:04:06 +08:00
xiao
2ceb940e8f refactor: 更新 Dockerfile 以使用更新的 rockylinux 基础镜像并移除不必要的依赖 2024-12-04 20:00:48 +08:00
xiao
3b1c0e5513 refactor: 更新 Dockerfile 使用 rockylinux:9-minimal 并调整依赖安装 2024-12-04 19:58:53 +08:00
xiao
f53b327b63 编辑文件 Dockerfile 2024-12-04 19:51:48 +08:00
xiao
cd9eb2691d refactor: 优化 Dockerfile 的构建流程和依赖安装 2024-12-04 19:40:28 +08:00
xiao
c63a313334 refactor: 更新 Dockerfile 使用 dnf 替代 yum 并清理缓存目录 2024-12-04 19:18:52 +08:00
xiao
988554213f refactor: 优化 Dockerfile 中的命令执行顺序 2024-12-04 18:37:45 +08:00
xiao
ca6a92b101 chore: 移除不必要的 epel-next-release 安装 2024-12-04 18:36:46 +08:00
xiao
61108c35a5 refactor: 优化 Dockerfile 中的包安装顺序 2024-12-04 18:35:29 +08:00
xiao
3138bca697 chore: 更新 Dockerfile 以使用更新的包管理器命令 2024-12-04 18:33:45 +08:00
xiao
cc29baa250 chore: 更新 Dockerfile 以启用 EPEL 2024-12-04 18:30:21 +08:00
xiao
7062879bfd chore: 优化 Dockerfile 的构建流程 2024-12-04 18:25:52 +08:00
xiao
058636ffcc chore: 更新 Dockerfile 以使用 yum-utils 并简化命令 2024-12-04 18:25:08 +08:00
xiao
715f8559d9 chore: 更新 Dockerfile 中的包管理器命令
将 Dockerfile 中的 `yum config-manager --set-enabled devel` 替换为 `dnf config-manager --set-enabled devel`,以使用更新的包管理器命令。
2024-12-04 18:22:43 +08:00
xiao
9659f1ad2f chore: 修正 Dockerfile 中的 repo 文件名匹配模式 2024-12-04 18:20:49 +08:00
xiao
72e62a83ab chore: 更新 .cnb.yml 文件以支持 Rocky Linux 9 2024-12-04 18:18:13 +08:00
xiao
74ab0060e9 refactor: 切换基础镜像并更新依赖版本 2024-12-04 18:17:50 +08:00
xiao
0eca35f261 feat: 更新宝塔面板 PHP 版本至 8.2
将宝塔面板中的 PHP 版
2024-12-04 16:06:51 +08:00
cnb.ZYsjO8G6wGA
4c262b34a5 chore: 优化 Dockerfile 的代码结构和格式 2024-12-04 15:41:53 +08:00
xiao
eb460df934 Add phpMyAdmin installation and uninstallation script for server environment setup 2024-12-04 14:52:31 +08:00
xiao
3a7e494d01 Add phpMyAdmin script to Dockerfile for lamp environment setup 2024-12-04 14:51:38 +08:00
xiao
1df0e19836 Add Baotai Panel and LNMP environment installation in Dockerfile 2024-12-04 14:41:39 +08:00
xiao
97ec756b9b Update .cnb.yml to use new CentOS 7.9 lamp configuration with Tencent Cloud mirror source 2024-12-04 14:25:37 +08:00
xiao
af5fcded80 init: lamp 2024-12-04 14:21:46 +08:00
xiao
537c7d2bd6 Update Dockerfile to use yum for cleaning and fixing CentOS mirror source 2024-12-04 12:37:05 +08:00
xiao
781e5ce202 chore: Add random hostname with btc7-prefix and update CentOS mirror source 2024-12-04 12:15:41 +08:00
xiao
02008b5c02 Update Dockerfile to switch CentOS mirror source to Tencent Cloud and simplify sed commands 2024-12-04 12:12:41 +08:00
xiao
dd36a58ac8 Update Dockerfile to correct CentOS extras mirror source URL 2024-12-04 12:02:03 +08:00
xiao
6c8feec95f Update Dockerfile to switch CentOS mirror source to Tencent Cloud and update dependencies 2024-12-04 11:57:29 +08:00
xiao
c16a8295b2 Update Dockerfile to remove EPEL repo and clean up mirror sources 2024-12-04 11:53:21 +08:00
xiao
50b71872e1 Update Dockerfile to switch CentOS mirror source to CentOS Vault and update dependencies 2024-12-04 11:46:08 +08:00
xiao
d45f9a3688 feat: 更新换源 2024-12-04 11:31:51 +08:00
xiao
f8b13a1d0c Update Docker build and push process, system identification, and Dockerfile for CentOS 7.9 2024-12-04 11:30:24 +08:00
xiao
4351cf8cbd refactor: 更新 Docker 镜像构建和推送流程 2024-11-26 11:04:39 +08:00
xiao
b02c18b40c feat: 更新系统标识 2024-11-25 12:36:55 +08:00
xiao
4f747761a5 chore: 更新构建配置以支持 bullseye 架构 2024-11-25 12:09:47 +08:00
xiao
1512ace87e build: 更新 Dockerfile 使用 Debian bullseye 版本并修正镜像源路径 2024-11-25 12:09:12 +08:00
xiao
9c36b27ca9 refactor: 更新 docker 构建和推送流程
优化了 docker 构建和推送流程,使用环境变量替代硬编码的镜像标签和凭证,增加了构建超时设置,并为 arm64
2024-11-25 12:07:11 +08:00
3 changed files with 42 additions and 37 deletions

View File

@ -5,17 +5,17 @@ $:
docker: docker:
build: build:
dockerfile: .ide/Dockerfile dockerfile: .ide/Dockerfile
rockylinux9:
push: push:
- runner: - runner:
tags: cnb:arch:amd64 tags: cnb:arch:amd64
services: services:
- docker - docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env: env:
IMAGE_TAG: btpanel/baota:latest_debian12-linux-amd64 IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH}-linux-amd64
stages: stages:
- name: docker login - name: docker login
script: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWD" script: docker login -u ${CNB_TOKEN_USER_NAME} -p "${CNB_TOKEN}" ${CNB_DOCKER_REGISTRY}
- name: docker build - name: docker build
script: docker build -t ${IMAGE_TAG} . script: docker build -t ${IMAGE_TAG} .
- name: docker push - name: docker push
@ -27,15 +27,16 @@ $:
- runner: - runner:
tags: cnb:arch:arm64:v8 tags: cnb:arch:arm64:v8
cpus: 16
services: services:
- docker - docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env: env:
IMAGE_TAG: btpanel/baota:latest_debian12-linux-arm64 IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH}-linux-arm64
stages: stages:
- name: docker login - name: docker login
script: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWD" script: docker login -u ${CNB_TOKEN_USER_NAME} -p "${CNB_TOKEN}" ${CNB_DOCKER_REGISTRY}
- name: docker build - name: docker build
timeout: 3600s
script: docker build -t ${IMAGE_TAG} . script: docker build -t ${IMAGE_TAG} .
- name: docker push - name: docker push
script: docker push ${IMAGE_TAG} script: docker push ${IMAGE_TAG}
@ -43,12 +44,13 @@ $:
type: cnb:resolve type: cnb:resolve
options: options:
key: build-arm64 key: build-arm64
- runner:
- services: tags: cnb:arch:amd64
cpus: 2
services:
- docker - docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env: env:
IMAGE_TAG: btpanel/baota:latest_debian12 IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH}
stages: stages:
- name: await the amd64 - name: await the amd64
type: cnb:await type: cnb:await
@ -61,8 +63,8 @@ $:
- name: manifest - name: manifest
image: cnbcool/manifest image: cnbcool/manifest
settings: settings:
username: $DOCKER_USERNAME username: $CNB_TOKEN_USER_NAME
password: $DOCKER_PASSWD password: $CNB_TOKEN
target: ${IMAGE_TAG} target: ${IMAGE_TAG}
template: ${IMAGE_TAG}-OS-ARCH template: ${IMAGE_TAG}-OS-ARCH
platforms: platforms:

View File

@ -1,19 +1,21 @@
FROM debian:bookworm FROM rockylinux:9
# 切换 Debian 镜像源为腾讯云源,更新包列表并安装依赖 # 设置构建参数
RUN sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list.d/debian.sources \ ARG RANDOM_NAME
&& apt update && apt upgrade -y \
&& apt install -y \ # 设置一个随机主机名
locales \ RUN echo "btr9-${RANDOM_NAME}" > /etc/hostname
wget iproute2 openssh-server libgd-dev cmake make gcc g++ autoconf \
libsodium-dev libonig-dev libssh2-1-dev libc-ares-dev libaio-dev sudo curl dos2unix \ # 切换 rockylinux 镜像源为腾讯云源,更新包列表并安装依赖
build-essential re2c cron bzip2 libzip-dev libc6-dev bison file rcconf flex vim m4 gawk less cpp binutils \ RUN sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.tencent.com/rocky|g' -i.bak /etc/yum.repos.d/rocky-*.repo && \
diffutils unzip tar libbz2-dev libncurses5 libncurses5-dev libtool libevent-dev libssl-dev libsasl2-dev \ dnf makecache && \
libltdl-dev zlib1g-dev libglib2.0-0 libglib2.0-dev libkrb5-dev libpq-dev libpq5 gettext libcap-dev \ (dnf install -y epel-release || dnf install -y epol-release 'dnf-command(config-manager)') && \
libc-client2007e-dev psmisc patch git e2fsprogs libxslt1-dev xz-utils libgd3 libwebp-dev libvpx-dev \ (dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled crb) || true && \
libfreetype6-dev libjpeg62-turbo libjpeg62-turbo-dev iptables libudev-dev libldap2-dev \ dnf repolist && \
&& apt clean \ dnf update -y && \
&& rm -rf /var/lib/apt/lists/* dnf install -y cronie perl perl-devel procps-ng which glibc-locale-source util-linux wget iproute openssh-server gd-devel cmake make gcc gcc-c++ autoconf libsodium-devel oniguruma libssh2-devel c-ares-devel libaio-devel sudo dos2unix bzip2 zip unzip tar ncurses-devel libtool libevent-devel openssl-devel cyrus-sasl-devel libtool-libs zlib-devel glib2 glib2-devel krb5-devel postgresql-devel gettext libcap-devel oniguruma-devel psmisc patch git e2fsprogs libxslt-devel xz libwebp-devel libvpx-devel freetype-devel libjpeg-turbo libjpeg-turbo-devel iptables systemd-devel openldap-devel && \
dnf clean all && \
rm -rf /var/cache/dnf
# 复制脚本 # 复制脚本
COPY ["bt.sh", "init_mysql.sh", "/"] COPY ["bt.sh", "init_mysql.sh", "/"]
@ -25,10 +27,10 @@ RUN dos2unix /bt.sh && dos2unix /init_mysql.sh
RUN curl -sSO https://download.bt.cn/install/install_panel.sh \ RUN curl -sSO https://download.bt.cn/install/install_panel.sh \
&& echo y | bash install_panel.sh -P 8888 --ssl-disable \ && echo y | bash install_panel.sh -P 8888 --ssl-disable \
&& rm -rf /www/server/data/* \ && rm -rf /www/server/data/* \
&& echo "docker_bt_d12" > /www/server/panel/data/o.pl \ && echo "docker_bt_r9" > /www/server/panel/data/o.pl \
&& echo '["memuA", "memuAsite", "memuAdatabase", "memuAcontrol", "memuAfiles", "memuAlogs", "memuAxterm", "memuAcrontab", "memuAsoft", "memuAconfig", "dologin", "memu_btwaf", "memuAssl"]' > /www/server/panel/config/show_menu.json \ && echo '["memuA", "memuAsite", "memuAdatabase", "memuAcontrol", "memuAfiles", "memuAlogs", "memuAxterm", "memuAcrontab", "memuAsoft", "memuAconfig", "dologin", "memu_btwaf", "memuAssl"]' > /www/server/panel/config/show_menu.json \
&& apt clean \ && dnf clean all \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/cache/dnf \
&& chmod +x /bt.sh \ && chmod +x /bt.sh \
&& chmod +x /init_mysql.sh && chmod +x /init_mysql.sh
@ -39,10 +41,10 @@ RUN echo btpanel | bt 6 \
&& echo "/btpanel" > /www/server/panel/data/admin_path.pl \ && echo "/btpanel" > /www/server/panel/data/admin_path.pl \
&& echo "root:btpaneldocker" | chpasswd && echo "root:btpaneldocker" | chpasswd
ENTRYPOINT ["/bin/sh","-c","/bt.sh"] ENTRYPOINT ["/bin/bash","-c","/bt.sh"]
# 暴漏所有端口 # 暴漏所有端口
EXPOSE 0-65535 EXPOSE 0-65535
# 健康检查 # 健康检查
HEALTHCHECK --interval=5s --timeout=3s CMD curl -i http://127.0.0.1:$(cat /www/server/panel/data/port.pl)$(cat /www/server/panel/data/admin_path.pl) | grep -E '(200|404)' || exit 1 HEALTHCHECK --interval=5s --timeout=3s CMD prot="http"; if [ -f "/www/server/panel/data/ssl.pl" ]; then prot="https"; fi; curl -k -i $prot://127.0.0.1:$(cat /www/server/panel/data/port.pl)$(cat /www/server/panel/data/admin_path.pl) | grep -E '(200|404)' || exit 1

11
bt.sh
View File

@ -31,14 +31,15 @@ soft_start(){
${init_path}/bt start ${init_path}/bt start
pkill crond pkill crond
/sbin/crond /usr/sbin/crond
ssh-keygen -A
chmod 600 /etc/ssh/ssh_host_* chmod 600 /etc/ssh/ssh_host_*
/usr/sbin/sshd -D & /usr/sbin/sshd &
} }
init_mysql(){ init_mysql(){
if [ "${O_pl}" != "docker_btlamp_d12" ] && [ "${O_pl}" != "docker_btlnmp_d12" ];then if [ "${O_pl}" != "docker_btlamp_r9" ] && [ "${O_pl}" != "docker_btlnmp_r9" ];then
return return
fi fi
if [ -d "${Data_Path}" ]; then if [ -d "${Data_Path}" ]; then
@ -51,7 +52,7 @@ init_mysql(){
fi fi
fi fi
if [ -f /init_mysql.sh ] && [ -d "${Setup_Path}" ];then if [ -f /init_mysql.sh ] && [ -d "${Setup_Path}" ];then
sh /init_mysql.sh bash /init_mysql.sh
rm -f /init_mysql.sh rm -f /init_mysql.sh
fi fi
} }