https://www.w3cschool.cn/doc_docker_1_11/docker_1_11-swarm-swarm-api-index.html
官方文档为主
docker安装
https://zhuanlan.zhihu.com/p/82269806
https://docs.docker.com/engine/install/centos/ 翻译
https://www.runoob.com/docker/docker-container-usage.html
https://www.runoob.com/docker/docker-install-mysql.html
HTML5 Canvas 超逼真烟花绽放动画
docker exec -it mongo mongo admin
docker
k8s
https://www.cnblogs.com/-wenli/p/13621862.html
db.createUser({ user:'admin',pwd:'123456',roles:[ { role:'userAdminAnyDatabase', db: 'admin'},"readWriteAnyDatabase"]});
db.auth('admin', '123456')
asp.net core web api docker 部署
docker Dockerfile
https://www.cnblogs.com/battor/p/publish_aspnet_core_webapi_to_docker_image.html
https://www.cnblogs.com/zhangnever/p/11961297.html
https://localhost:5001/HelloWorld/Hello
https://www.cnblogs.com/luoocean/p/11100684.html
https://blog.csdn.net/weixin_43474597/article/details/114296311
https://www.bbsmax.com/A/obzblQBB5E/
Asp.Net Core WebApi 5.0+Dapper+Mysql+Redis+Docker
docker build -t apiproject .
docker run -d -p 9659:80 --name corewebapi apiproject
curl localhost:9659/HelloWorld/Hello
https://www.cnblogs.com/-wenli/p/13621862.html
界面
https://xw.qq.com/amphtml/20220506A001ZT00
https://doc.mbalib.com/view/e6d6590bb1761238fc9e84aac4824bb0.html
https://juejin.cn/post/6881626030550908935
https://zhuanlan.zhihu.com/p/82269806
docker exec -it mysql-test /bin/bash
docker run --name nginx-test -p 9999:80 -d nginx
https://www.runoob.com/docker/docker-install-nginx.html
这些服务需要用到Nacos、MySQL、Nginx、ElasticSearch、Kibana、Redis、JDK和 Minio 文件存储服务器。
[root@localhost ~]# cd publish
[root@localhost publish]# docker build -t apiproject .
Sending build context to Docker daemon 4.681MB
Step 1/19 : FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
5.0: Pulling from dotnet/aspnet
4be315f6562f: Already exists
72dac22b18b5: Pull complete
9cdd5a1bfae7: Pull complete
eb32402ab2a8: Pull complete
e4e2eb51b5be: Pull complete
Digest: sha256:f2b08fda5029c160ba9751a870e1a77d71c09905a72b7560d6cc735e8498a1cd
Status: Downloaded newer image for mcr.microsoft.com/dotnet/aspnet:5.0
---> 99323686c908
Step 2/19 : RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
---> Running in 7a8db34f4589
Removing intermediate container 7a8db34f4589
---> b44b82698444
Step 3/19 : RUN echo 'Asia/Shanghai' >/etc/timezone
---> Running in 0d440db5a812
Removing intermediate container 0d440db5a812
---> 399bb82a3620
Step 4/19 : WORKDIR /app
---> Running in 3539bc226bae
Removing intermediate container 3539bc226bae
---> a918171dcc6a
Step 5/19 : EXPOSE 80
---> Running in 2df8f6baed06
Removing intermediate container 2df8f6baed06
---> f380643f9e06
Step 6/19 : EXPOSE 443
---> Running in 12d897538b20
Removing intermediate container 12d897538b20
---> e11d81b70a02
Step 7/19 : FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
5.0: Pulling from dotnet/sdk
4be315f6562f: Already exists
72dac22b18b5: Already exists
9cdd5a1bfae7: Already exists
eb32402ab2a8: Already exists
e4e2eb51b5be: Already exists
a24fd5e6af6a: Pull complete
a1923f86117c: Pull complete
3a6796630657: Pull complete
Digest: sha256:b69acf0a0734d77827d4e7ce22421256a64d490bb3ce988b21c4527398f610c3
Status: Downloaded newer image for mcr.microsoft.com/dotnet/sdk:5.0
---> 980860f258df
Step 8/19 : WORKDIR /src
---> Running in 968f074c05d2
Removing intermediate container 968f074c05d2
---> 5e092ee8406a
Step 9/19 : COPY ["Demo.csproj", "."]
COPY failed: file not found in build context or excluded by .dockerignore: stat Demo.csproj: file does not exist
[root@localhost publish]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4b0ac96964c8 nginx "/docker-entrypoint.…" 41 minutes ago Up 40 minutes 0.0.0.0:9999->80/tcp, :::9999->80/tcp nginx-test
a03872de6bed mysql "docker-entrypoint.s…" 46 minutes ago Up 46 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mysql-test
33b155ee9ec7 mongo "docker-entrypoint.s…" 50 minutes ago Up 50 minutes 0.0.0.0:27017->27017/tcp, :::27017->27017/tcp mongo
d40ff47e349c redis "docker-entrypoint.s…" 54 minutes ago Up 54 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp redis-test
[root@localhost publish]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mongo latest 27dd1be4bed1 6 days ago 700MB
redis latest a10f849e1540 8 days ago 117MB
mysql latest 96d0eae5ed60 8 days ago 524MB
nginx latest fa5269854a5e 2 weeks ago 142MB
mcr.microsoft.com/dotnet/sdk 5.0 980860f258df 2 weeks ago 632MB
mcr.microsoft.com/dotnet/aspnet 5.0 99323686c908 2 weeks ago 205MB
hello-world latest feb5d9fea6a5 7 months ago 13.3kB
[root@localhost publish]# docker run -d -p 9659:80 --name corewebapi apiproject
Unable to find image 'apiproject:latest' locally
docker: Error response from daemon: pull access denied for apiproject, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
[root@localhost publish]# docker build -t apiproject .
Sending build context to Docker daemon 4.681MB
Step 1/17 : FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
---> 99323686c908
Step 2/17 : WORKDIR /app
---> Running in db4a4a635479
Removing intermediate container db4a4a635479
---> 6bfd0ae137d8
Step 3/17 : EXPOSE 80
---> Running in c6b6fbbcc2e8
Removing intermediate container c6b6fbbcc2e8
---> 4f430f99f5f8
Step 4/17 : EXPOSE 443
---> Running in 66c51e3801d4
Removing intermediate container 66c51e3801d4
---> dfb1f17d9406
Step 5/17 : FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
---> 980860f258df
Step 6/17 : WORKDIR /src
---> Using cache
---> 5e092ee8406a
Step 7/17 : COPY ["Demo.csproj", "."]
COPY failed: file not found in build context or excluded by .dockerignore: stat Demo.csproj: file does not exist
[root@localhost publish]# docker build -t apiproject .
Sending build context to Docker daemon 4.681MB
Step 1/7 : FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
---> 99323686c908
Step 2/7 : WORKDIR /app
---> Using cache
---> 6bfd0ae137d8
Step 3/7 : EXPOSE 80
---> Using cache
---> 4f430f99f5f8
Step 4/7 : EXPOSE 443
---> Using cache
---> dfb1f17d9406
Step 5/7 : WORKDIR /app
---> Running in 463949e44b0b
Removing intermediate container 463949e44b0b
---> 3694459898f2
Step 6/7 : COPY . /app
---> 7434e5324ba1
Step 7/7 : ENTRYPOINT ["dotnet", "Demo.dll"]
---> Running in 4cea45d7d651
Removing intermediate container 4cea45d7d651
---> 845ebf1a655c
Successfully built 845ebf1a655c
Successfully tagged apiproject:latest
[root@localhost publish]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apiproject latest 845ebf1a655c 18 seconds ago 210MB
mongo latest 27dd1be4bed1 6 days ago 700MB
redis latest a10f849e1540 8 days ago 117MB
mysql latest 96d0eae5ed60 8 days ago 524MB
nginx latest fa5269854a5e 2 weeks ago 142MB
mcr.microsoft.com/dotnet/sdk 5.0 980860f258df 2 weeks ago 632MB
mcr.microsoft.com/dotnet/aspnet 5.0 99323686c908 2 weeks ago 205MB
hello-world latest feb5d9fea6a5 7 months ago 13.3kB
[root@localhost publish]# docker run -d -p 9659:80 --name corewebapi apiproject
83289d2a2ee443cffef999df9c0b1f17554356ce286eeaf1a207dc3c003897f4
[root@localhost publish]# curl localhost:5001/HelloWorld/Hello
curl: (7) Failed connect to localhost:5001; Connection refused
[root@localhost publish]# curl localhost:9659/HelloWorld/Hello
Hello ASP.NET Core 3.1![root@localhost publish]# ^C
[root@localhost publish]# ^C
[root@localhost publish]#



