VS2017 dockerfile:COPY ${source:-obj/Docker/publish}
Visual Studio 2017添加Docker支持后,会生成Dockerfile,其内容大概如下:
FROM microsoft/aspnetcore:2.0
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "aspnetcore2-20170530.dll"]
复制指令:
COPY ${source:-obj/Docker/publish}
指令中${source:-obj/Docker/publish}是bash的默认替换变量,意思是取$source变量,如果没有找到则使用“:-”后面的值作为默认值。
这条复制指令的意思是:复制$source路径到当前目录,如果$source没有赋值,默认路径为obj/Docker/publish。