Compare commits

..

38 Commits
lamp ... main

Author SHA1 Message Date
b21ccb6344 取消国内镜像源 2025-04-01 20:03:43 +08:00
09fb13638e 修改 tags 2 2025-04-01 19:35:56 +08:00
eefc67c34f 修改 tags 2025-04-01 19:33:52 +08:00
2a5d694708 添加工作流 2025-04-01 19:29:29 +08:00
xiao
ec7393435d docs: 更新 README.md 中的 Docker Run 命令示例 2025-03-19 15:53:38 +08:00
xiao
466dccaf9b docs: 修正 Docker Compose 配置中的卷路径 2025-03-19 15:51:40 +08:00
xiao
1622719b66 docs: 修正 Docker 使用部分格式,使其更规范 2025-03-11 18:26:05 +08:00
xiao
b9a3bb1342 优化 Dockerfile 和 bt.sh:打包宝塔面板并清除 www 目录,调整脚本中部分函数执行顺序 2025-03-11 11:25:28 +08:00
yolokk
583e94973a docs: 更新 README.md 添加 Docker 使用参考格式 2025-03-08 16:56:37 +08:00
xiao
b7548bb509 docs: 更新使用说明 2025-01-09 11:31:53 +08:00
xiao
02f02aef88 feat: 添加说明 2025-01-09 11:15:31 +08:00
xiao
71eab61a5d feat: 新增 issue 开启和重新打开时的通知功能 2025-01-09 10:06:37 +08:00
xiao
3306ff3ef3 fix: 将bug报告模板中的报错日志输入框改为文本域以支持多行输入 2025-01-09 09:53:43 +08:00
xiao
5fb61374d0 feat: 优化ISSUE提交体验 2025-01-09 09:50:57 +08:00
xiao
7d64f66acb fix: 修改备份数据库时间戳格式为 Unix 时间戳
将备份数据库函数中的时间戳格式从 `%Y%m%d%H%M%S` 修改为 Unix 时间戳 `%s`,保证时间格式统一且更利于数值计算和处理。
2025-01-07 16:07:09 +08:00
xiao
7704973d73 perf: 优化宝塔面板安装过程,使用腾讯云 PyPI 镜像源 2025-01-07 12:18:47 +08:00
xiao
bcc6565dc2 fix: 修正备份数据库条件判断逻辑 2025-01-07 11:19:46 +08:00
xiao
0237f60bdd feat: 新增数据库备份与恢复功能 2025-01-07 11:07:47 +08:00
xiao
6fb41b2423 Update Dockerfile to expose specific ports and maintain health check support for HTTPS 2024-12-18 15:57:39 +08:00
xiao
058032aaac feat: 更新构建流水线 2024-12-09 14:34:21 +08:00
xiao
8da406ce23 feat: 新增删除构建流程 2024-12-09 14:32:07 +08:00
xiao
03a3701ff4 chore: 更新 .cnb.yml 和 bt.sh 文件以支持多架构构建和推送 2024-12-09 14:30:10 +08:00
xiao
38cae6fb5c fix: 更新健康检查以支持 HTTPS 2024-12-09 14:15:00 +08:00
xiao
4061313742 chore: 更新 clear 阶段以使用新的镜像和参数 2024-12-05 12:15:48 +08:00
xiao
f22c403daa feat: 添加 remove tag 阶段以清理过时的镜像标签 2024-12-05 12:05:35 +08:00
cnb.ZYsjO8G6wGA
48d1bc7fd5 chore: 更新镜像标签以符合命名规范 2024-12-04 15:34:08 +08:00
xiao
b80f88f5ab chore: 更新镜像标签格式 2024-11-16 22:29:15 +08:00
xiao
cc6fb795a1 chore: 更新 Docker 镜像标签格式 2024-11-16 22:15:07 +08:00
xiao
883071c25b refactor: 简化重复代码结构 2024-11-16 22:13:27 +08:00
xiao
9ff3d5d87a feat: 更新 Docker 镜像标签和登录凭证变量 2024-11-16 22:04:24 +08:00
xiao
bae411eb28 chore: 修改镜像标签中的分隔符
将 `latest-debian12` 修改为 `latest_debian12`,以保持一致性。
2024-11-15 15:34:18 +08:00
xiao
c3f9ced0f2 feat: 添加新的构建和推送流程
新增了一个针对 btpanel/baota:latest-debian12 镜像的构建和推送流程,包括对应的 docker.yml 导入和环境变量设置。
2024-11-15 15:32:44 +08:00
xiao
0c9522e569 refactor: 更新宝塔面板菜单配置 2024-11-15 14:38:56 +08:00
xiao
b2849efc84 chore: 移除宝塔面板菜单中的 memu 相关选项 2024-11-15 14:23:54 +08:00
xiao
428764cc0d feat: 更新 Dockerfile 以优化构建过程并增加新功能
- 合并更新包列表和安装依赖的命令
- 新增 init_mysql.sh 脚本并复制到镜像中
- 更新宝塔面板安装命令以清理数据目录并设置新的标识文件
- 转换 init_mysql.sh 脚本的换行符并赋予可执行权限
- 配置宝塔面板安全入口、用户名、密码以及 SSH 密码
2024-11-14 18:00:25 +08:00
xiao
7c2e2badeb feat: 更新启动脚本 2024-11-05 19:02:51 +08:00
xiao
bb49891b74 feat: 配置区域设置 2024-11-02 13:58:39 +08:00
xiao
9a1fba71e7 fix: 删除构建phpmyadmin 2024-11-02 13:56:39 +08:00
10 changed files with 196 additions and 146 deletions

View File

@ -5,6 +5,32 @@ $:
docker:
build:
dockerfile: .ide/Dockerfile
issue.open:
- stages:
- name: issue-notice
image: tencentcom/wecom-message
imports: https://cnb.cool/btpanel/secret/-/blob/main/wework-robots.yml
settings:
robot: $CNB_WARRIOR_ROBOT
msgType: markdown
content: |
> **有人提issue啦**
> **标 题:** $CNB_ISSUE_TITLE
> **发起人:** $CNB_ISSUE_OWNER
> **查看:** [$CNB_EVENT_URL]($CNB_EVENT_URL)
issue.reopen:
- stages:
- name: issue-notice
image: tencentcom/wecom-message
imports: https://cnb.cool/btpanel/secret/-/blob/main/wework-robots.yml
settings:
robot: $CNB_WARRIOR_ROBOT
content: |
> **$CNB_BUILD_USER重新打开了一个issue**
> **标 题:** $CNB_ISSUE_TITLE
> **发起人:** $CNB_ISSUE_OWNER
> **查 看:** [$CNB_EVENT_URL]($CNB_EVENT_URL)
push:
- runner:
tags: cnb:arch:amd64
@ -12,7 +38,7 @@ $:
- docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env:
IMAGE_TAG: btpanel/baota:lamp-linux-amd64
IMAGE_TAG: btpanel/baota:latest-linux-amd64
stages:
- name: docker login
script: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWD"
@ -27,17 +53,15 @@ $:
- runner:
tags: cnb:arch:arm64:v8
cpus: 16
services:
- docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env:
IMAGE_TAG: btpanel/baota:lamp-linux-arm64
IMAGE_TAG: btpanel/baota:latest-linux-arm64
stages:
- name: docker login
script: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWD"
- name: docker build
timeout: 3600s
script: docker build -t ${IMAGE_TAG} .
- name: docker push
script: docker push ${IMAGE_TAG}
@ -46,14 +70,11 @@ $:
options:
key: build-arm64
- runner:
tags: cnb:arch:amd64
cpus: 2
services:
- services:
- docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env:
IMAGE_TAG: btpanel/baota:lamp
IMAGE_TAG: btpanel/baota:latest
stages:
- name: await the amd64
type: cnb:await
@ -88,7 +109,7 @@ $:
services:
- docker
env:
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:lamp-linux-amd64
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest-linux-amd64
stages:
- name: docker login
script: docker login -u ${CNB_TOKEN_USER_NAME} -p "${CNB_TOKEN}" ${CNB_DOCKER_REGISTRY}
@ -103,16 +124,14 @@ $:
- runner:
tags: cnb:arch:arm64:v8
cpus: 16
services:
- docker
env:
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:lamp-linux-arm64
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest-linux-arm64
stages:
- name: docker login
script: docker login -u ${CNB_TOKEN_USER_NAME} -p "${CNB_TOKEN}" ${CNB_DOCKER_REGISTRY}
- name: docker build
timeout: 3600s
script: docker build -t ${IMAGE_TAG} .
- name: docker push
script: docker push ${IMAGE_TAG}
@ -127,7 +146,7 @@ $:
services:
- docker
env:
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:lamp
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest
stages:
- name: await the amd64
type: cnb:await
@ -152,6 +171,6 @@ $:
options:
name: ${CNB_REPO_NAME}
tags:
- lamp-linux-amd64
- lamp-linux-arm64
- latest-linux-amd64
- latest-linux-arm64
type: docker

View File

@ -0,0 +1,22 @@
name: feature request
description: 该模版用于提需求
labels:
- feature
body:
- type: markdown
attributes:
value: |
感谢用户提出的改进 宝塔面板Docker镜像 的想法。
请尽可能填写以下内容
- type: textarea
attributes:
label: 这个特性将解决什么问题?
validations:
required: true
- type: textarea
attributes:
label: 设想的解决方案?如有
- type: textarea
attributes:
label: 您考虑过哪些替代方案?如有

View File

@ -0,0 +1,20 @@
name: bug report
description: 该模版用于反馈 bug
labels:
- bug
body:
- type: textarea
attributes:
label: 提供报错说明&截图?如有,可更快的确认问题
validations:
required: true
- type: textarea
attributes:
label: 提供一下报错日志?如环境/插件安装日志,或其他报错信息
validations:
required: false
- type: textarea
attributes:
label: 描述一下重现步骤?
validations:
required: false

View File

@ -0,0 +1,13 @@
name: experience improve
description: 该模版用于反馈体验问题
labels:
- 体验优化
body:
- type: textarea
attributes:
label: 描述一下体验不好的点
validations:
required: true
- type: textarea
attributes:
label: 优化建议?如有

View File

@ -0,0 +1 @@
blank_issues_enabled: true

View File

@ -0,0 +1,38 @@
name: Docker Image Build and Push
on:
workflow_dispatch:
inputs:
version:
description: '版本标签'
required: true
default: '9.5.0'
jobs:
build-and-push-multiarch:
name: Build and Push Multi-Arch Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push multi-arch Docker images
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ldxw/btpanel:latest
ldxw/btpanel:${{ github.event.inputs.version }}

View File

@ -1,8 +1,9 @@
FROM debian:bookworm
# 切换 Debian 镜像源为腾讯云源,更新包列表并安装依赖
RUN sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list.d/debian.sources \
&& apt update && apt upgrade -y \
RUN #sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list.d/debian.sources \
#&&
apt update && apt upgrade -y \
&& apt install -y \
locales \
wget iproute2 openssh-server libgd-dev cmake make gcc g++ autoconf \
@ -17,30 +18,16 @@ RUN sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list.d/debi
# 复制脚本
COPY ["bt.sh", "init_mysql.sh", "/"]
COPY ["phpmyadmin.sh", "/lamp/"]
# 转换启动脚本
RUN dos2unix /bt.sh && dos2unix /init_mysql.sh
# 下载并安装宝塔面板及 lamp 环境
# 下载并安装宝塔面板及 lnmp 环境
RUN curl -sSO https://download.bt.cn/install/install_panel.sh \
&& echo y | bash install_panel.sh -P 8888 --ssl-disable
RUN curl -o /lamp/apache.sh https://download.bt.cn/install/0/apache.sh \
&& sh /lamp/apache.sh install 2.4 \
&& curl -o /lamp/php.sh https://download.bt.cn/install/4/php.sh \
&& sh /lamp/php.sh install 8.3 \
&& curl -o /lamp/mysql.sh https://download.bt.cn/install/4/mysql.sh \
&& sh /lamp/mysql.sh install 8.0 \
&& sh /lamp/phpmyadmin.sh install 5.2 \
&& rm -rf /lamp \
&& rm -rf /www/server/php/83/src \
&& rm -rf /www/server/mysql/mysql-test \
&& rm -rf /www/server/mysql/src.tar.gz \
&& rm -rf /www/server/mysql/src \
&& echo y | bash install_panel.sh -P 8888 --ssl-disable \
#&& btpip config set global.index-url https://mirrors.tencent.com/pypi/simple \
&& rm -rf /www/server/data/* \
&& rm -rf /www/server/apache/src \
&& echo "docker_btlamp_d12" > /www/server/panel/data/o.pl \
&& echo "docker_bt_d12" > /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 \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* \
@ -53,7 +40,7 @@ RUN echo btpanel | bt 6 \
&& echo btpaneldocker | bt 5 \
&& echo "/btpanel" > /www/server/panel/data/admin_path.pl \
&& echo "root:btpaneldocker" | chpasswd
# 打包宝塔面板并清除www
RUN bt 2 \
&& tar -zcf /www.tar.gz /www \

58
README.md Normal file
View File

@ -0,0 +1,58 @@
> 此 Docker 镜像由宝塔面板官方发布,镜像版本为宝塔面板 9.3.0 正式版和 9.0.0_lts 稳定版,镜像会随着宝塔面板更新,目前支持`x86_64``arm64`架构。
![badge](https://cnb.cool/btpanel/btpanel/-/badge/git/latest/ci/git-clone-yyds)
![badge](https://cnb.cool/btpanel/btpanel/-/badge/git/latest/ci/pipeline-as-code)
![badge](https://cnb.cool/btpanel/btpanel/-/badge/git/latest/ci/status/push)
## 使用方法
> 以下命令中的镜像默认使用 CNB 仓库镜像,如需直接从 DockerHub 拉取,请替换镜像地址,如将`docker.cnb.cool/btpanel/btpanel:latest`替换为`btpanel:baota:latest`
### Docker Run
- 复制下方的命令无需映射端口使用本地网络直接部署宝塔面板docker镜像
```bash
docker run -d --restart unless-stopped --name baota --net=host -v ~/www:/www docker.cnb.cool/btpanel/btpanel:latest
```
- 复制下方的命令映射指定端口部署宝塔面板docker镜像
```bash
docker run -d --restart unless-stopped --name baota -p 8888:8888 -p 22:22 -p 443:443 -p 80:80 -p 888:888 -v ~/www:/www docker.cnb.cool/btpanel/btpanel:latest
```
### Docker Compose
```yml
services:
btpanel:
image: docker.cnb.cool/btpanel/btpanel:latest # 宝塔面板官方镜像国内源也可直接使用dockerhub镜像 btpanel/baota:latest
deploy:
resources:
limits:
cpus: "2.0" # 最大CPU核心限制根据实际情况调整
memory: "1024M" # 最大内存限制,根据实际情况调整
restart_policy:
condition: always
ports:
- "38888:8888" # 宝塔面板对外访问端口默认38888
- "8080:80" # Web服务端口默认8080
- "8443:443" # HTTPS服务端口默认8443
- "33306:3306" # MySQL服务端口默认33306不需要暴露到容器外可删除
- "22022:22" # SSH服务端口默认22022不需要暴露到容器外可删除
- "32888:888" # PHPMyAdmin服务端口默认32888不需要暴露到容器外可删除
volumes:
- "/www:/www" # 持久化存储宝塔面板数据,默认/www可根据实际情况调整目录
labels:
createdBy: "bt_apps"
```
## 如果面板需要使用Docker
参考格式 本地docker环境挂载进面板docker使用
```yml
- "/usr/bin/docker:/usr/bin/docker"
- "/run/docker.sock:/run/docker.sock"
```
## 镜像说明
除标注了`9.0_lts`稳定版的标签外,其他镜像均为`9.3.0/9.2.0`正式版
- `latest`:基于`Debian12`镜像打包,安装了宝塔面板和后续安装环境所用的依赖。
- `nas`:基于`Debian12`镜像打包,安装了宝塔面板和`Nginx 1.27`(amd架构)或`Nginx openresty`(arm64架构)
- `9.0_lts_fresh`:基于`Debian12`镜像打包,安装了宝塔面板稳定版。
- `9.0_lts_lib`:基于`Debian12`镜像打包,安装了宝塔面板稳定版和和后续安装环境所用的依赖。
- `slim`:基于`debian:bookworm-slim`镜像打包,仅安装了宝塔面板,体积较小。

2
bt.sh
View File

@ -69,7 +69,7 @@ init_mysql(){
fi
fi
if [ -f /init_mysql.sh ] && [ -d "${Setup_Path}" ];then
sh /init_mysql.sh
bash /init_mysql.sh
rm -f /init_mysql.sh
fi
}

View File

@ -1,108 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
public_file=/www/server/panel/install/public.sh
if [ ! -f $public_file ];then
wget -O $public_file https://download.bt.cn/install/public.sh -T 5;
fi
. $public_file
download_Url=$NODE_URL
Root_Path=`cat /var/bt_setupPath.conf`
Setup_Path=$Root_Path/server/phpmyadmin
webserver=""
Install_phpMyAdmin()
{
if [ -d "${Root_Path}/server/apache" ];then
webserver='apache'
elif [ -d "${Root_Path}/server/nginx" ];then
webserver='nginx'
elif [ -f "/usr/local/lsws/bin/lswsctrl" ];then
webserver='openlitespeed'
fi
if [ "${webserver}" == "" ];then
echo "No Web server installed!"
exit 0;
fi
PHPVersion=""
for phpVer in 52 53 54 55 56 70 71 72 73 74 80 81 82 83;
do
if [ -d "/www/server/php/${phpVer}/bin" ]; then
PHPVersion=${phpVer}
fi
done
if [ -z $PHPVersion ];then
echo "======================================"
echo "当前没有可用php停止安装"
echo "请先安装好php后再进行安装phpmyadmin"
exit 1;
fi
wget -O phpMyAdmin.zip $download_Url/src/phpMyAdmin-${1}.zip -T20
mkdir -p $Setup_Path
unzip -o phpMyAdmin.zip -d $Setup_Path/ > /dev/null
rm -f phpMyAdmin.zip
rm -rf $Root_Path/server/phpmyadmin/phpmyadmin*
phpmyadminExt=`cat /dev/urandom | head -n 32 | md5sum | head -c 16`;
mv $Setup_Path/databaseAdmin $Setup_Path/phpmyadmin_$phpmyadminExt
chmod -R 755 $Setup_Path/phpmyadmin_$phpmyadminExt
chown -R www.www $Setup_Path/phpmyadmin_$phpmyadminExt
chmod 755 /www/server/phpmyadmin
secret=`cat /dev/urandom | head -n 32 | md5sum | head -c 32`;
\cp -a -r $Setup_Path/phpmyadmin_$phpmyadminExt/config.sample.inc.php $Setup_Path/phpmyadmin_$phpmyadminExt/config.inc.php
sed -i "s#^\$cfg\['blowfish_secret'\].*#\$cfg\['blowfish_secret'\] = '${secret}';#" $Setup_Path/phpmyadmin_$phpmyadminExt/config.inc.php
sed -i "s#^\$cfg\['blowfish_secret'\].*#\$cfg\['blowfish_secret'\] = '${secret}';#" $Setup_Path/phpmyadmin_$phpmyadminExt/libraries/config.default.php
echo $1 > $Setup_Path/version.pl
if [ "${webserver}" == "nginx" ];then
sed -i "s#$Root_Path/wwwroot/default#$Root_Path/server/phpmyadmin#" $Root_Path/server/nginx/conf/nginx.conf
rm -f $Root_Path/server/nginx/conf/enable-php.conf
\cp $Root_Path/server/nginx/conf/enable-php-$PHPVersion.conf $Root_Path/server/nginx/conf/enable-php.conf
sed -i "/pathinfo/d" $Root_Path/server/nginx/conf/enable-php.conf
if [ ! -f "/www/server/nginx/conf/enable-php.conf" ];then
touch /www/server/nginx/conf/enable-php.conf
fi
/etc/init.d/nginx reload
PMA_PORT=$(cat $Root_Path/server/nginx/conf/nginx.conf|grep "listen "|grep -oE '[0-9]+')
else
sed -i "s#$Root_Path/wwwroot/default#$Root_Path/server/phpmyadmin#" $Root_Path/server/apache/conf/extra/httpd-vhosts.conf
sed -i "0,/php-cgi/ s/php-cgi-\w*\.sock/php-cgi-${PHPVersion}.sock/" $Root_Path/server/apache/conf/extra/httpd-vhosts.conf
/etc/init.d/httpd reload
PMA_PORT=$(cat /www/server/apache/conf/extra/httpd-vhosts.conf |grep "Listen "|grep -oE '[0-9]+')
fi
echo ${PMA_PORT} > /www/server/phpmyadmin/port.pl
}
Uninstall_phpMyAdmin()
{
rm -rf $Root_Path/server/phpmyadmin/phpmyadmin*
rm -f $Root_Path/server/phpmyadmin/version.pl
rm -f $Root_Path/server/phpmyadmin/version_check.pl
}
actionType=$1
version=$2
if [ "$actionType" == 'install' ];then
Install_phpMyAdmin $version
elif [ "$actionType" == 'uninstall' ];then
Uninstall_phpMyAdmin
fi