硬件发展速度:asp.net+sql+redis+nginx:资源利用率太低,多软件工具不能隔离,相互影响,不能快速部署
0.docker 简介和使用总结:image,container,dockfile,nginx,redis,compose
默认镜像:精简版linux+coreclr
1.可定制的安装包
2.不建议运行时修改配置文件
容器:运维工具
镜像容器里部署asp.netcore webapi
配置文件名要小写:lognet4.config
docker exec -it 1092
cat ls
cat appsettings.json
clear
docker hub :镜像库
2.--------docker file 用来构建镜像的文本
docer run -d -p 8081:80 -v /vip/epublish:/app --wrkdir /app mcr.microsoft.com/dotnet/core/aspnet dotnet /app/zhaoxi.aspnetcore31.dockerproject.dll
docker build -t core31v1.619 -f Dockerfile .
docker run -itd -p 8082:80 core31v1.619
docker logs core31v1.619
docker rmi core31v1.619
docker stop $(docker ps -q) & docker rm $(docker ps -aq) #一次性删除全部容器
1.发布后的文件+官方CLR镜像
docker run -d -p 8081:80 -v /vip/epublish:/app --workdir /app mcr.microsoft.com/dotnet/core/aspnet dotnet /app/Zhaoxi.AspNetCore31.DockerProject.dll
docker run -d -p 8081:80 -v /vip/epublish:/app --workdir /app mcr.microsoft.com/dotnet/core/aspnet dotnet /app/Zhaoxi.AspNetCore31.DockerProject.dll
2.用dockerfile 去构建镜像
Asp.Net Core+Dockerfile 2 Build镜像 3 Run
docker build -t core31v1.619 -f Dockerfile .
docker run -itd -p 8082:80 core31v1.619
3.nginx+集群
Nginx镜像 单独的nginx.conf(对应版本) 修改配置文件,挂载进去 Run
docker run -d -p 8086:80 -v /vip/enginx/:/var/log/nginx/ -v /vip/enginx/nginx.conf:/etc/nginx/nginx.conf:ro --name elnginx nginx
4.docker+redis
docker run -d -p 8085:6380 -v /vip/eredis/redis.conf:/usr/local/etc/redis/redis.conf -v /vip/eredis/data:/data:rw --name redis02 redis:6.0 redis-server /usr/local/etc/redis/redis.conf
bgsave,绑定Ip,开启redis远程访问
5.docker + redis + 虚拟网卡
下载 curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
授权 chmod +x /usr/local/bin/docker-compose docker-compose docker-compose –version docker-compose stop
6.基于compse创建容器:docker compose , docker 管理
下载 curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
授权 chmod +x /usr/local/bin/docker-compose docker-compose docker-compose –version docker-compose stop
7.compse.yml批处理一次创建2个asp.netcore,redis,nginx容器
www.toyaml.com在线检查yaml文件格式
-d 后端运行
8.docker machine:管理多台服务器主机
9.docker swarm 集群管理工具
10.kubernets--google
docer search nginx
docker pull nginx
docker logs e232
docker exec -it e232 /bin/bash
ls
cd etc
ls
cd nginx
ls
cat nginx.config
------------------
虚拟机VM
docker
namespace
centos7+docker+ecs+asp.netcore (1he2g)
docker --version
docker ps -a
docket stop 9f3a
up exited
systemctl start
clear
docker logs id
curl:
docker run hello word
精简版linux+coreclr
docker pull mcr.microsoft/aspnetcore:latest
.netframework(mono)