image - 如何扩大码头集装箱尺寸?
问题描述
我需要通过以下步骤创建一个大的 docker 镜像:
- 使用以下信息创建 Dockerfile:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202-bionic as build
ARG BUILDCONFIG=RELEASE
ARG VERSION=1.0.0
WORKDIR .
COPY . /build/
COPY Model/Model.sln /build/Model/
RUN dotnet build ./build/Model/Model.sln
RUN dotnet restore ./build/Model/Model.sln
WORKDIR /build/Model
RUN dotnet publish Model.sln -c $BUILDCONFIG -o out /p:Version=$VERSION
- 使用以下命令构建 docker 镜像
$ docker build -t modelwithpr .
Sending build context to Docker daemon 27.39GB
Step 1/10 : FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202-bionic as build
3.1.202-bionic: Pulling from dotnet/core/sdk
23884877105a: Pull complete
bc38caa0f5b9: Pull complete
2910811b6c42: Pull complete
36505266dcc6: Pull complete
21e3523d71cd: Pull complete
3c423fdfc300: Pull complete
3c953506ccad: Pull complete
3b8b572de54f: Pull complete
8f2eb870f86d: Pull complete
e52b20b76b9c: Pull complete
Digest: sha256:9ee35c3d8395a15b21cc2eca5d66c8e7df62254c12ddb1249731c568458de124
Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/sdk:3.1.202-bionic
---> 82688290b31f
Step 2/10 : ARG BUILDCONFIG=RELEASE
---> Running in 74f348453403
Removing intermediate container 74f348453403
---> f07df710b48e
Step 3/10 : ARG VERSION=1.0.0
---> Running in d1556dc14108
Removing intermediate container d1556dc14108
---> 63b311ef2174
Step 4/10 : WORKDIR .
---> Running in acd6a2b9f467
Removing intermediate container acd6a2b9f467
---> cecc23485351
Step 5/10 : COPY . /build/
Error processing tar file(exit status 1): write /build/Model/bin/Debug/netcoreapp3.1/Microsoft.Data.SqlClient.dll: no space left on device
我检查了路径 Library/Containers/com.docker.docker/Data/vms/0/data 发现 Docker.raw 文件是 59GB(不知道为什么这么大)。
有没有办法扩大容器尺寸?
解决方案
推荐阅读
- node.js - docker container exited with "Local package.json exists, but node_modules missing, did you mean to install?" message
- assembly - 如何为 MS-DOS 制作音频驱动程序?
- windows - 从 arp -a 中提取 IP 地址用于映射映射网络驱动器
- ios - Swift Firebase - 使用个人资料照片进行用户注册
- android-studio - 在 Android Studio 中注销 App Actions 测试工具?
- javascript - 商店调度功能不接受我的参数
- angular - 装饰器不支持函数调用,但调用了“NgForageModule”
- css - 将子元素背景颜色应用于父元素的填充
- c - 为什么在调用 realloc() 后,模运算会出现浮点异常?
- webpack - NormalModuleReplacementPlugin 在稍微修改 resourceRegExp 时不起作用