azure 环境设置
-
登录azure
- 使用微软账号就可以进行登录。
- 点击右上角新建项目
项目信息,尽量用小写
创建项目
修改默认的dockerfile
```
FROM microsoft/dotnet:2.1-aspnetcore-runtime-stretch-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.1-sdk-stretch AS build
RUN mkdir -p /app
WORKDIR /src
COPY . .
RUN dotnet restore "firstapp.csproj"
RUN dotnet build "firstapp.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "firstapp.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "firstapp.dll"]
```
准备dockerhub账号
- 地址: https://hub.docker.com/
- 创建一个免费仓库
到现在为止,docker仓库创建完毕,代码仓库也创建完毕,准备开始构建。