先移除docker相关软件
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
开机启动
systemctl enable docker
启动
systemctl start docker
=========================配置KMS服务===============================
拉取kms Docker
docker pull luodaoyi/kms-server
后台启动,并添加别名kms
docker run -itd --name kms -p 1688:1688 luodaoyi/kms-server
开机启动容器
docker update --restart=always kms
===================================================================
激活office
cd C:\Program Files\Microsoft Office\Office15
cscript ospp.vbs /sethst:192.168.0.125
cscript ospp.vbs /act
激活windows
wmic os get caption
slmgr /ipk xxxxx-xxxxx-xxxxx-xxxxx
slmgr /skms 192.168.0.125
slmgr /ato
=========================配置es服务===============================
docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2
docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.2
docker update --restart=always es
--进入docker
docker exec -it es /bin/bash
# 显示文件
ls
结果如下:
LICENSE.txt README.textile config lib modules
NOTICE.txt bin data logs plugins
# 进入配置文件夹
cd config
# 显示文件
ls
结果如下:
elasticsearch.keystore ingest-geoip log4j2.properties roles.yml users_roles
elasticsearch.yml jvm.options role_mapping.yml users
# 修改配置文件
vi elasticsearch.yml
# 加入跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
docker restart es
#配置es_head服务
docker pull mobz/elasticsearch-head:5
docker run -d --name es_admin -p 9100:9100 mobz/elasticsearch-head:5
docker update --restart=always es_admin
http://localhst:9200;
=========================配置nginx服务===============================
nginx
--https://github.com/nginxinc/docker-nginx/blob/master/stable/alpine-perl/Dockerfile
curl -O https://raw.githubusercontent.com/nginxinc/docker-nginx/master/stable/alpine-perl/Dockerfile
docker build -t nginx:1.16 -f Dockerfile .
=========================配置tomcat服务===============================
docker pull tomcat
docker run -d --name tm8000 -p 8000:8000 tomcat
docker exec -it tm8000 /bin/bash
ls
cd webapps
mkdir index
cd index
echo "hello jack" -> index.html
=========================配置mysql服务===============================
docker pull mysql
-- 3310对外端口
docker run --name mysql -p 3310:3306 -e MYSQL_ROOT_PASSWORD=11111111 -d mysql
docker update --restart=always mysql
--进入docker
docker exec -it mysql bash
-- 下面这一步可能要等一会
mysql -h 127.0.0.1 -u root -p / mysql -u root -p
use mysql;
--报如下错误,原因是老版本navicat不支持mysql新的加密方式 client does not support authentication protocol requested by server;consider upgrading mysql client;
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘11111111‘;
ALTER USER ‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘11111111‘;
flush privileges;
exit; --退出mysql
exit; --退出docker
docker restart mysql;
centos 6.9安装 docker,及docker中安装KMS、ss、elasticsearch、nginx、tomcat、mysql