分类 "Docker" 下的文章

准备工作:
安装docker-compose

#https://github.com/docker/compose/releases
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.12.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
#检查是否正确安装
docker-compose version

阅读全文

docker build -t mbsapi .

打包已发布的系统

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
#Dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 5566

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

ADD ./net6.0/ /app
ENTRYPOINT ["dotnet", "Admin.dll","--urls","https://*:5566"]

阅读全文