1.添加一个Dockerfile文件,将其移到解决方案文件夹,模板如下: FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build WORKDIR /app # copy csproj and restore as distinct layers COPY *.sln . COPY aspnetapp/*.csproj ./aspnetapp/ RUN dotnet restore # copy everything else and build a
镜像操作 列出镜像: $ sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE hello-world latest 0a6ba66e537a weeks ago B 获取镜像: docker系统镜像可以从任意一个可访问的镜像仓库获取,默认从docker hub上获取,如果下载太慢的话可以考虑国内的镜像仓库,例如dl.dockerpool.com:5000或者阿里云镜像库下载. docker获取镜像用docker pull
首先使用 docker info 查看 docker 的基本信息 sudo docker info Containers: 0 Images: 5 Storage Driver: devicemapper Pool Name: docker-253:0-679369-pool Pool Blocksize: 65.54 kB Backing Filesystem: extfs Data file: Metadata file: Data Space Used: 533.9 MB Data Spa