Docker-超过最大深度 [英] Docker - max depth exceeded
问题描述
所以我正在使用此示例:
So I am using this example:
https: //github.com/mcmoe/mssqldocker
为了创建SQL Server映像并向其中加载数据。我有几个运行容器时运行的SQL脚本。
In order to create a SQL Server image and load it with data. I have several sql scripts which I run when I run the container.
但是,在构建映像时,我开始出现此错误:
However, I started getting this error when building the image:
Step 7/9 : ENTRYPOINT ./entrypoint.sh
---> Running in c8c654f6a630
max depth exceeded
我不确定如何解决此问题,我重新启动了docker,甚至对其进行了更新。
我读了一些有关125层的东西?谁能解释这个问题的原因以及可能的解决方法?
I'm not sure how to fix this, I restarted docker and even updated it. I read something about 125 layers? Can anyone explain the cause of this and a potential fix?
我发现此命令可以运行:
I found this command to run:
docker history microsoft/mssql-server-linux:latest | wc -l
312
我的docker-compose yml:
My docker-compose yml:
version: "3"
services:
mssql:
build: .
image: 'microsoft/mssql-server-linux'
ports:
- '1433:1433'
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=Abcgfgh123!
volumes:
- db_volume:/var/lib/mssql/data
volumes:
db_volume:
推荐答案
服务的
image
参数$ docker-compose.yml
定义中的c $ c>具有双重含义,这取决于 build
参数的存在。
The image
parameter for a service
in a docker-compose.yml
definition has dual meanings depending on the existence of a build
parameter.
-
如果没有
build
节,则image
将被拉出并运行。
If there is no
build
stanza, Theimage
will just be pulled and run.
如果您有版本
节,则图片
将您构建的
图像标记为的名称,然后运行。
If you have a build
stanza, image
will be the name your built
image is tagged as, and run.
通过命名生成的映像 microsoft / mssql-server-linux
,与 FROM microsoft / mssql-server-linux
映像相同。 Docker每次都将构建置于自身之上。
By naming the built image microsoft/mssql-server-linux
, which is the same as the FROM microsoft/mssql-server-linux
image. Docker was layering the build on top of itself each time.
原始版本开始于官方 microsoft / mssql-server-linux
,但随后的每个后续版本从本地的 microsoft / mssql-server-linux
映像开始,直到最终达到存储驱动程序的最大层数。
The original build started on the "official" microsoft/mssql-server-linux
but then each subsequent build would start from your local microsoft/mssql-server-linux
image which had been appended to, until eventually you hit the maximum number of layers for your storage driver.
对构建的所有图像使用自己的命名空间:
Use your own namespace for all images you build:
version: "3"
services:
mssql:
build: .
image: 'user3437721/mssql-server-linux'
这篇关于Docker-超过最大深度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!