在centos7上用docker安装宝塔面板

 
1. [root@web01 ~]# systemctl enable docker

2. [root@web01 ~]# docker pull centos

3. [root@web01 ~]# docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
baota               1.0                 6112bf8cd2f8        2 hours ago         1.94GB
centos              latest              0f3e07c0138f        13 days ago         220MB
nginx               latest              f949e7d76d63        2 weeks ago         126MB
busybox             latest              19485c79a9bb        5 weeks ago         1.22MB
php                 5.6-fpm             3458979c7744        8 months ago        344MB
4. [root@web01 ~]# docker run -d -p 80:80 -p 443:443 -p 8888:8888 --name web --privileged=true centos /usr/sbin/init
fde8c437e30b14e1a61dfd95aae2ef51d3b20d16d8be168251995f7e38092d37

5.  [root@web01 ~]# docker ps

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                                              NAMES
fde8c437e30b        centos              "/usr/sbin/init"    13 seconds ago      Up 11 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8888->8888/tcp   web
6. [root@web01 ~]# docker stop web
 

7. [root@web01 ~]# docker update --restart=always web

8.[root@web01 ~]# docker start web

 
9.[root@web01 ~]# docker exec -it web /bin/bash

10. [root@fde8c437e30b /]# yum update

11. [root@fde8c437e30b /]# yum install -y wget && wget -O http://download.bt.cn/install/install_6.0.sh && sh install.sh

 
Congratulations! Installed successfully!
==================================================================
Bt-Panel: http://121.13.54.208:8888/fcb6c8b4
username: yrkayh40
password: ca3ce04c
Warning:
If you cannot access the panel, 
release the following port (8888|888|80|443|20|21) in the security group
==================================================================
Time consumed: 4 Minute!
[root@fde8c437e30b /]# 
 

12 [root@fde8c437e30b /]# systemctl start bt

13  [root@fde8c437e30b /]# systemctl enable bt
bt.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable bt

14.  root@fde8c437e30b /]# /etc/rc.d/init.d/bt default

==================================================================
BT-Panel default info!
==================================================================
Bt-Panel-URL: http://121.13.54.208:8888/fcb6c8b4
username: yrkayh40
password: ca3ce04c
Warning:
If you cannot access the panel, 
release the following port (8888|888|80|443|20|21) in the security group
==================================================================
 
 

15 root@fde8c437e30b /]# yum install openssh-server

16.[root@fde8c437e30b /]# systemctl enable sshd

补充:一些常用的指令

1.统计目录的大小

[root@web01 docker]# ls -lh
总用量 256M
drwxr-xr-x. root root 10月 : conf
-rw-r--r--. root root 15K 10月 : epel-release-latest-.noarch.rpm
-rw-r--r--. root root 175M 10月 : fornarina-backup---.7z
drwxr-xr-x. root root 10月 : images
drwxr-xr-x. root root 10月 : nginx
drwxr-xr-x. root root 10月 : www
 

2 查看文件系统容量

[root@web01 /]# df -mh
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 899M 899M % /dev
tmpfs 910M 910M % /dev/shm
tmpfs 910M 9.5M 901M % /run
tmpfs 910M 910M % /sys/fs/cgroup
/dev/mapper/centos-root 50G .5G 43G % /
/dev/sda1 1014M 149M 866M % /boot
/dev/mapper/centos-home 27G 33M 27G % /home
tmpfs 182M 182M % /run/user/
overlay 50G .5G 43G % /var/lib/docker/overlay2/2e821c708514585fb6e1ed141fc25a7b62f9b804898ab113749d49f8605b48ac/merged

3.修改yum 源为国内源

[root@web01 yum.repos.d]# cat /etc/system-release
CentOS Linux release 7.7.1908 (Core)
[root@web01 yum.repos.d]# cd /etc/yum.repos.d/
[root@web01 yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo docker-ce.repo epel-testing.repo
[root@web01 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.backup # 备份 [root@web01 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

[root@web01 yum.repos.d]# yum makecache    --更新源数据缓存

[root@web01 yum.repos.d]# yum -y update

  已加载插件:fastestmirror
  Loading mirror speeds from cached hostfile
  * base: mirrors.aliyun.com
  * epel: fedora.cs.nctu.edu.tw
  * extras: mirrors.aliyun.com
  * updates: mirrors.aliyun.com
  正在解决依赖关系

4.查看操作系统版本与位数

[root@web01 docker]# uname -s
Linux
[root@web01 docker]# uname -rv
3.10.-.el7.x86_64 # SMP Wed Aug :: UTC
[root@web01 docker]# uname -m
x86_64

5.查看当前系统时区与时间设置

[root@web01 etc]# timedatectl
Local time: 三 -- :: CST
Universal time: 三 -- :: UTC
RTC time: 三 -- ::
Time zone: Asia/Shanghai (CST, +)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
[root@web01 etc]# ntpdate ntp1.aliyun.com #与阿里云时间服务器同步
Oct :: ntpdate[]: adjust time server 120.25.115.20 offset 0.002538 sec
时间诇整指令
timedatectl list-timezones: 列出所有时区
timedatectl set-local-rtc 将硬件时钟调整为与本地时钟一致, 为设置为 UTC 时间
timedatectl set-timezone Asia/Shanghai 设置系统时区为上海
 
 

在centos7上用docker安装宝塔面板的更多相关文章

  1. 手把手教你docker安装宝塔面板

    手把手教你docker安装宝塔面板(针对小白提一下:需要先安装docker,安装docker的教程请自行百度,非常简单的),docker安装宝塔面板教程如下: 一.拉取centos镜像(当然这里拉取别 ...

  2. 2021 docker安装宝塔面板

    拉取CentOS镜像 docker pull centos 创建 docker 容器 启动镜像,映射主机与容器内8888(宝塔面板).888(PHPMYADMIN)端口 -v 挂在目录 为了能够保存( ...

  3. 【docker】使用docker 安装 宝塔面板

    拉取centos基础镜像,用容器启动该基础镜像,直接在这个容器中部署 1 拉取纯净系统镜像 docker pull centos: 2 启动镜像,映射主机与容器内8888端口 docker run - ...

  4. docker安装宝塔面板

    1.下载centos docker docker pull centos:7.2.1511 2.运行镜像设置端口 docker run -d -it -p 4001:8888 -p 4000:80 - ...

  5. docker中安装宝塔面板

    我的电脑是win10,安装的virtualbox其上装的ubutun14,ubutun也安装了docker,今天我补充一个完整的操作流程.怎么在docker中安装宝塔面板?先打个岔,这些命令总是记不住 ...

  6. Vultr VPS建站攻略 – 一键安装宝塔面板架设LNMP/LAMP Web环境

    我们选择VULTR VPS建站的还是比较多的,其主要原因在于商家的稳定,毕竟我们用来建站选择服务器价格考虑的不是主要的(当然VULTR价格也是比较便宜),最为主要的是因为VULTR商家比较稳定,而且多 ...

  7. 购买阿里云ECS+安装宝塔面板+Mac下怎么连接阿里云ECS服务器

    1.购买阿里云ECS 2.重置实例密码 这个有点对用户不友好,实际意思就是设置服务器的root登录密码 3.配置安全组放行端口 因为服务器需要从宝塔网站download安装包,包括一些常用的服务比如S ...

  8. 在CentOS7上通过RPM安装实现LAMP+phpMyAdmin过程全记录

    在CentOS7上通过RPM安装实现LAMP+phpMyAdmin过程全记录 时间:2017年9月20日 一.软件环境: IP:192.168.1.71 Hostname:centos73-2.sur ...

  9. Centos7上HBase的安装和配置

    注意事项 HBase配置必须使用主机名,不支持直接配置IP地址.我尝试过,如果不使用主机名直接用IP,会导致HBase连接zk超时. > 设置主机名 hostnamectl set-hostna ...

随机推荐

  1. SaltStack--配置管理

    saltstack配置管理 Saltstack状态模块 远程执行模块的执行是过程式,而状态是对minion的一种描述和定义,管理人员不需要关系部署任务如何完成的,只需要描述minion的状态描述.它的 ...

  2. linux启动脚本

    1. linux启动脚本 :  /etc/init.d/脚本例如:/etc/init.d/iptables start init.d/ 下面的每一个文件就是一个启动脚本 2. 以上的/etc/init ...

  3. nginx+Gunicorn部署你的Flask项目

    https://www.cnblogs.com/minsons/articles/8191219.html 大家在学习python的时候常常都是输入 python 文件名.py 这样启动小脚本 但实际 ...

  4. LoarRunner脚本录制-Port Mapping

    使用LR录制脚本时经常会因为内外网访问限制,或浏览器兼容等问题,导致无法正常录制脚本. 这里简单介绍一下使用LR端口映射的方式进行脚本录制,与之前介绍的<Jmeter脚本录制--HTTP代理服务 ...

  5. TensorFlow之estimator详解

    Estimator初识 框架结构 在介绍Estimator之前需要对它在TensorFlow这个大框架的定位有个大致的认识,如下图示: 可以看到Estimator是属于High level的API,而 ...

  6. CAN通信帧ID的含义解析? (转载)

    https://www.cnblogs.com/isAndyWu/p/10298695.html这个文章解答了我的一个id使用的疑惑,因此谢谢作者,转载. CAN总线ID是包含在报文帧中的. 1.主要 ...

  7. LeetCode 722. Remove Comments

    原题链接在这里:https://leetcode.com/problems/remove-comments/ 题目: Given a C++ program, remove comments from ...

  8. PipelineWise illustrates the power of Singer

    转自:https://www.stitchdata.com/blog/pipelinewise-singer/ Stitch is based on Singer, an open source st ...

  9. MySQL数据库中文乱码问题

    mysql> select * from books; +-----+---------------------------------+---------+-------------+---- ...

  10. 《京东上千页面搭建基石——CMS前后端分离演进史》阅读笔记

    一.背景 CMS即内容管理系统,目的是用于快速进行网站建设或者网页开发. 对于京东网站部门来说,CMS核心目的是用来快速开发和上线各种页面,诸如各种垂直频道页. 二.CMS核心目的 进行数据和模板的统 ...