Git Product home page Git Product logo

baota's Introduction

Docker 部署宝塔面板

此方案可能是全网最快的 宝塔面板 部署方案。该镜像基于 宝塔Linux正式版 7.7.0(官方纯净版,可升级) 制作。维护脚本使用 Python 开发,源码和 Dockerfile 均已上传至 GitHub(欢迎您的 Star)。

本镜像仅保留了最精简的 宝塔面板,未安装任何插件。初始化容器后,您可以根据需要选择安装插件。"Simple is better than complex!" 此外,如果您在生产环境下部署宝塔面板,请务必参考 方案二 创建容器。

支持系统:Linux,macOS(支持 Apple silicon),Windows

架构:x86-64,ARM 64

使用方法如下:

(注:为了方便部署,该镜像去除了安全入口,您可以自行配置)

方案一(最快化部署)

docker run -itd --net=host --restart=always \
--name baota cyberbolt/baota \
-port 端口号 -username 用户名 -password 密码

示例如

docker run -itd --net=host --restart=always \
--name baota cyberbolt/baota \
-port 8888 -username cyberbolt -password abc123456

--net=host : 容器和主机使用同一网络

--restart=always: 守护进程,容器挂掉将自动重启

-port : 填写宝塔面板运行的端口号

-username: 填写宝塔面板的用户名

-password : 填写宝塔面板的密码

该方法的登录方式:

登陆地址: http://{{服务器的ip地址}}:{{您输入的端口号}}

账号: 您填写的用户名

密码: 您填写的密码

如果您未自定义用户名和密码,直接使用的如下命令

docker run -itd --net=host --restart=always \
--name baota cyberbolt/baota

宝塔面板也会自动创建,此时可通过默认信息登录,默认信息为


登陆地址: http://{{服务器的ip地址}}:8888

账号: cyber

密码: abc12345

方案二(生产环境部署)

生产环境中,为了避免极小概率的数据丢失,我们将容器内的宝塔文件映射到宿主机的目录中(您之后安装的 Nginx、MySQL 等服务均会挂载到宿主机目录)。该方法是 Docker 部署宝塔面板的最优方案,可以在生产环境中运行。

首先按最简方案创建一个测试容器(为保存宝塔文件到宿主机目录中)

输入命令创建测试容器(这里仅为测试容器,为避免出错,后面几步请原封不动地复制粘贴)

docker run -itd --net=host \
--name baota-test cyberbolt/baota \
-port 26756 -username cyberbolt -password abc123456

将 Docker 容器中的 /www 目录 拷贝至宿主机的 /www

docker cp baota-test:/www /www

拷贝完成后删除创建的测试容器

docker stop baota-test && docker rm baota-test

创建宝塔面板容器,并将宿主机目录映射至容器中(自行输入面板的 端口号、用户名 和 密码 后即可完成部署)

docker run -itd -v /www:/www --net=host --restart=always \
--name baota cyberbolt/baota \
-port 端口号 -username 用户名 -password 密码

示例如

docker run -itd -v /www:/www --net=host --restart=always \
--name baota cyberbolt/baota \
-port 8888 -username cyberbolt -password abc123456

--net=host : 容器和主机使用同一网络

--restart=always: 守护进程,容器挂掉将自动重启

-port : 填写宝塔面板运行的端口号

-username: 填写宝塔面板的用户名

-password : 填写宝塔面板的密码

该方法的登录方式:

登陆地址: http://{{服务器的ip地址}}:{{您输入的端口号}}

账号: 您填写的用户名

密码: 您填写的密码

部署成功!

电光笔记官网 https://www.cyberlight.xyz/

baota's People

Contributors

cyberbolt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

baota's Issues

Nginx无法安装

宝塔啥都没安装刚想安装Nginx就提示这个了,是我docker设置有问题吗?

屏幕截图 2024-05-12 220522

无法启动

delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile(b'.\xef\xbc\x9a')
正在设置面板端口
正在设置面板用户名
Traceback (most recent call last):
File "script.py", line 98, in
main()
File "script.py", line 82, in main
bt_init(data['port'], data['username'], data['password'])
File "script.py", line 42, in bt_init
child.expect('.
:'.encode('utf-8'))
File "/usr/local/lib/python3.7/dist-packages/pexpect/spawnbase.py", line 344, in expect
timeout, searchwindowsize, async_)
File "/usr/local/lib/python3.7/dist-packages/pexpect/spawnbase.py", line 372, in expect_list
return exp.expect_loop(timeout)
File "/usr/local/lib/python3.7/dist-packages/pexpect/expect.py", line 179, in expect_loop
return self.eof(e)
File "/usr/local/lib/python3.7/dist-packages/pexpect/expect.py", line 122, in eof
raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7fc792f38d30>
command: /usr/bin/bt
args: ['/usr/bin/bt']
buffer (last 100 chars): b''
before (last 100 chars): b't.pl: No such file or directory\r\n/usr/bin/bt: line 339: /usr/bin/python: No such file or directory\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 127
flag_eof: True
pid: 22
child_fd: 6
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile(b'.\xef\xbc\x9a')
正在设置面板端口
正在设置面板用户名
Traceback (most recent call last):
File "script.py", line 98, in
main()
File "script.py", line 82, in main
bt_init(data['port'], data['username'], data['password'])
File "script.py", line 42, in bt_init
child.expect('.
:'.encode('utf-8'))
File "/usr/local/lib/python3.7/dist-packages/pexpect/spawnbase.py", line 344, in expect
timeout, searchwindowsize, async_)
File "/usr/local/lib/python3.7/dist-packages/pexpect/spawnbase.py", line 372, in expect_list
return exp.expect_loop(timeout)
File "/usr/local/lib/python3.7/dist-packages/pexpect/expect.py", line 179, in expect_loop
return self.eof(e)
File "/usr/local/lib/python3.7/dist-packages/pexpect/expect.py", line 122, in eof
raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7f4903fc9c88>
command: /usr/bin/bt
args: ['/usr/bin/bt']
buffer (last 100 chars): b''
before (last 100 chars): b't.pl: No such file or directory\r\n/usr/bin/bt: line 339: /usr/bin/python: No such file or directory\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 127
flag_eof: True
pid: 22
child_fd: 6
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile(b'.*\xef\xbc\x9a')

命令

docker run -itd --net=host --restart=always -v /srv/dev-disk-by-uuid-89fd10bb-5192-4cfb-beac-f547395b3209/bt_data:/www \
--name bt-panel cyberbolt/baota \
-port 8888 -username homeserver -password <*****>

不能使用docker命令映射端口

命令:
docker run -itd -v /www:/www --net=host --restart=always
--name baota2 cyberbolt/baota:latest
-p 1180:80 -port 28888 -username cyberbolt -password abc123456

结果:
usage: script.py [-h] [-port PORT] [-username USERNAME] [-password PASSWORD]
script.py: error: ambiguous option: -p could match -port, -password

尝试过把 -p 换成 -port,但好像没有用。-port只是宝塔面板的端口

不能把端口映射出去,就无法在外面访问宝塔面板里安装的网站了

使用bridge的方式,启动失败

想用 bridge 的方式启动,但是会报错。
启动命令如下:
docker run -d --name baota -v /volume1/docker/baota/www:/www -p 8888:8888 cyberbolt/baota:latest -port 8888 -username name -password pwd123

初始化报错

正在设置面板端口
Traceback (most recent call last):
  File "script.py", line 95, in <module>
    main()
  File "script.py", line 79, in main
    bt_init(data['port'], data['username'], data['password'])
  File "script.py", line 31, in bt_init
    child.expect('.*:'.encode('utf-8'))
  File "/usr/local/lib/python3.7/dist-packages/pexpect/spawnbase.py", line 344, in expect
    timeout, searchwindowsize, async_)
  File "/usr/local/lib/python3.7/dist-packages/pexpect/spawnbase.py", line 372, in expect_list
    return exp.expect_loop(timeout)
  File "/usr/local/lib/python3.7/dist-packages/pexpect/expect.py", line 179, in expect_loop
    return self.eof(e)
  File "/usr/local/lib/python3.7/dist-packages/pexpect/expect.py", line 122, in eof
    raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7fa568ec88>
command: /usr/bin/bt
args: ['/usr/bin/bt']
buffer (last 100 chars): b''
before (last 100 chars): b't.pl: No such file or directory\r\n/usr/bin/bt: line 339: /usr/bin/python: No such file or directory\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 8
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile(b'.*\xef\xbc\x9a')

lnmp下的nginx安装不了

/configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.
企业微信截图_20230203115239

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.