Docker – max depth exceeded

The image parameter for a service in a docker-compose.yml definition has dual meanings depending on the existence of a build parameter.

  • If there is no build stanza, The image 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.

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.

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'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)