Compare commits
15 Commits
9.0_lts_fr
...
main
Author | SHA1 | Date | |
---|---|---|---|
b21ccb6344 | |||
09fb13638e | |||
eefc67c34f | |||
2a5d694708 | |||
![]() |
ec7393435d | ||
![]() |
466dccaf9b | ||
![]() |
1622719b66 | ||
![]() |
b9a3bb1342 | ||
![]() |
583e94973a | ||
![]() |
b7548bb509 | ||
![]() |
02f02aef88 | ||
![]() |
71eab61a5d | ||
![]() |
3306ff3ef3 | ||
![]() |
5fb61374d0 | ||
![]() |
7d64f66acb |
26
.cnb.yml
26
.cnb.yml
@ -5,6 +5,32 @@ $:
|
|||||||
docker:
|
docker:
|
||||||
build:
|
build:
|
||||||
dockerfile: .ide/Dockerfile
|
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:
|
push:
|
||||||
- runner:
|
- runner:
|
||||||
tags: cnb:arch:amd64
|
tags: cnb:arch:amd64
|
||||||
|
22
.cnb/ISSUE_TEMPLATE/0-feature-request.yml
Normal file
22
.cnb/ISSUE_TEMPLATE/0-feature-request.yml
Normal 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: 您考虑过哪些替代方案?如有
|
20
.cnb/ISSUE_TEMPLATE/2-bug-report.yml
Normal file
20
.cnb/ISSUE_TEMPLATE/2-bug-report.yml
Normal 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
|
13
.cnb/ISSUE_TEMPLATE/3-experience-report.yml
Normal file
13
.cnb/ISSUE_TEMPLATE/3-experience-report.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
name: experience improve
|
||||||
|
description: 该模版用于反馈体验问题
|
||||||
|
labels:
|
||||||
|
- 体验优化
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: 描述一下体验不好的点
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: 优化建议?如有
|
1
.cnb/ISSUE_TEMPLATE/config.yml
Normal file
1
.cnb/ISSUE_TEMPLATE/config.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
blank_issues_enabled: true
|
38
.gitea/workflows/build-docker-images.yml
Normal file
38
.gitea/workflows/build-docker-images.yml
Normal 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 }}
|
||||||
|
|
12
Dockerfile
12
Dockerfile
@ -1,8 +1,9 @@
|
|||||||
FROM debian:bookworm
|
FROM debian:bookworm
|
||||||
|
|
||||||
# 切换 Debian 镜像源为腾讯云源,更新包列表并安装依赖
|
# 切换 Debian 镜像源为腾讯云源,更新包列表并安装依赖
|
||||||
RUN sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list.d/debian.sources \
|
RUN #sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list.d/debian.sources \
|
||||||
&& apt update && apt upgrade -y \
|
#&&
|
||||||
|
apt update && apt upgrade -y \
|
||||||
&& apt install -y \
|
&& apt install -y \
|
||||||
locales \
|
locales \
|
||||||
wget iproute2 openssh-server libgd-dev cmake make gcc g++ autoconf \
|
wget iproute2 openssh-server libgd-dev cmake make gcc g++ autoconf \
|
||||||
@ -24,7 +25,7 @@ RUN dos2unix /bt.sh && dos2unix /init_mysql.sh
|
|||||||
# 下载并安装宝塔面板及 lnmp 环境
|
# 下载并安装宝塔面板及 lnmp 环境
|
||||||
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 \
|
||||||
&& btpip config set global.index-url https://mirrors.tencent.com/pypi/simple \
|
#&& btpip config set global.index-url https://mirrors.tencent.com/pypi/simple \
|
||||||
&& rm -rf /www/server/data/* \
|
&& rm -rf /www/server/data/* \
|
||||||
&& echo "docker_bt_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 \
|
&& echo '["memuA", "memuAsite", "memuAdatabase", "memuAcontrol", "memuAfiles", "memuAlogs", "memuAxterm", "memuAcrontab", "memuAsoft", "memuAconfig", "dologin", "memu_btwaf", "memuAssl"]' > /www/server/panel/config/show_menu.json \
|
||||||
@ -40,6 +41,11 @@ 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
|
||||||
|
|
||||||
|
# 打包宝塔面板,并清除www
|
||||||
|
RUN bt 2 \
|
||||||
|
&& tar -zcf /www.tar.gz /www \
|
||||||
|
&& rm -rf /www
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/sh","-c","/bt.sh"]
|
ENTRYPOINT ["/bin/sh","-c","/bt.sh"]
|
||||||
|
|
||||||
# 暴漏特定端口
|
# 暴漏特定端口
|
||||||
|
58
README.md
Normal file
58
README.md
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
> 此 Docker 镜像由宝塔面板官方发布,镜像版本为宝塔面板 9.3.0 正式版和 9.0.0_lts 稳定版,镜像会随着宝塔面板更新,目前支持`x86_64`和`arm64`架构。
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## 使用方法
|
||||||
|
> 以下命令中的镜像默认使用 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`镜像打包,仅安装了宝塔面板,体积较小。
|
||||||
|
|
3
bt.sh
3
bt.sh
@ -11,7 +11,7 @@ O_pl=$(cat /www/server/panel/data/o.pl)
|
|||||||
backup_database() {
|
backup_database() {
|
||||||
if [ -d "${Data_Path}" ] && [ ! -z "$(ls -A ${Data_Path})" ]; then
|
if [ -d "${Data_Path}" ] && [ ! -z "$(ls -A ${Data_Path})" ]; then
|
||||||
if [ ! -d "${Setup_Path}" ] || [ -z "$(ls -A ${Setup_Path})" ]; then
|
if [ ! -d "${Setup_Path}" ] || [ -z "$(ls -A ${Setup_Path})" ]; then
|
||||||
timestamp=$(date +"%Y%m%d%H%M%S")
|
timestamp=$(date +"%s")
|
||||||
tar czf /www/server/data_backup_$timestamp.tar.gz -C ${Data_Path} .
|
tar czf /www/server/data_backup_$timestamp.tar.gz -C ${Data_Path} .
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -86,7 +86,6 @@ start_mysql(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
restore_panel_data > /dev/null
|
restore_panel_data > /dev/null
|
||||||
backup_database > /dev/null
|
backup_database > /dev/null
|
||||||
is_empty_Data > /dev/null
|
is_empty_Data > /dev/null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user