Unknown parent image ID

Hi,

Recently we have been getting this intermittent docker build error unknown parent image ID sha256:<sha> . Running the build again works. Has anyone else come across this issue?

Issue type: Docker build issue

OS Version/build:
NAME=“Amazon Linux AMI”
VERSION=“2018.03”
ID=“amzn”
ID_LIKE=“rhel fedora”
VERSION_ID=“2018.03”
PRETTY_NAME=“Amazon Linux AMI 2018.03”
ANSI_COLOR=“0;33”
CPE_NAME=“cpe:/o:amazon:linux:2018.03:ga”
HOME_URL=“http://aws.amazon.com/amazon-linux-ami/

App version:
Docker version 18.06.1-ce, build e68fc7a215d7133c34aa18e3b72b4a21fd0c6136

Steps to reproduce:

docker build \
-f docker/images/"${IMAGE_DIR}"/"${IMAGE_NAME}" \
--build-arg NODE_ENV="${NODE_ENV}" \
--build-arg SENTRY_RELEASE="${SENTRY_RELEASE}" \
--build-arg CONFIG_KEY="${CONFIG_KEY}" \
-t "${IMAGE_NAME}" .

Dockerfile:

FROM <ECR Image url>
WORKDIR /app
ENV NODE_PATH=/app/custom_modules
ENV TZ=America/Los_Angeles
ENTRYPOINT ["npm", "run"]

ARG NODE_ENV="${NODE_ENV}"
ENV NODE_ENV="${NODE_ENV}"
ARG SENTRY_RELEASE="${SENTRY_RELEASE}"
ENV SENTRY_RELEASE="${SENTRY_RELEASE}"
ENV APP_ENV="${NODE_ENV}"
ARG CONFIG_KEY="${CONFIG_KEY}"
ENV CONFIG_KEY="${CONFIG_KEY}"

COPY package-lock.json /app
COPY package.json /app
RUN npm ci;

ENV PORT=3500
COPY custom_modules /app/custom_modules
COPY subApp /app/subApp

WORKDIR /app/subApp
RUN NODE_ENV=development npm ci;

RUN npm run build;

WORKDIR /app
COPY config /app/config
COPY gitInfo.json /app/gitInfo.json

WORKDIR /app/subApp

Error Output:

15:29:03 Step 1/25 : FROM <ECR Image url>
15:29:03  ---> 0d1b6998c6a4
15:29:03 Step 2/25 : WORKDIR /app
15:29:03  ---> Using cache
15:29:03  ---> 97eeb286a9a0
15:29:03 Step 3/25 : ENV NODE_PATH=/app/custom_modules
15:29:03  ---> Using cache
15:29:03  ---> facfdbfc1b22
15:29:03 Step 4/25 : ENV TZ=America/Los_Angeles
15:29:03  ---> Using cache
15:29:03  ---> 26edd22ed6de
15:29:03 Step 5/25 : ENTRYPOINT ["npm", "run"]
15:29:03  ---> Using cache
15:29:03  ---> 2ad0dd60beda
15:29:03 Step 6/25 : ARG NODE_ENV="${NODE_ENV}"
15:29:03  ---> Using cache
15:29:03  ---> c7d3ffd5c582
15:29:03 Step 7/25 : ENV NODE_ENV="${NODE_ENV}"
15:29:03  ---> Using cache
15:29:03  ---> da882b19f89c
15:29:03 Step 8/25 : ARG SENTRY_RELEASE="${SENTRY_RELEASE}"
15:29:03  ---> Using cache
15:29:03  ---> f00edfd0aec3
15:29:03 Step 9/25 : ENV SENTRY_RELEASE="${SENTRY_RELEASE}"
15:29:03  ---> Running in 84b3505c07ff
15:29:03 Removing intermediate container 84b3505c07ff
15:29:03  ---> cb766fcd9d18
15:29:03 Step 10/25 : ENV APP_ENV="${NODE_ENV}"
15:29:03  ---> Running in 54f88bbf4a84
15:29:03 Removing intermediate container 54f88bbf4a84
15:29:03  ---> c9895d2fb7f4
15:29:03 Step 11/25 : ARG CONFIG_KEY="${CONFIG_KEY}"
15:29:03  ---> Running in 354c0e63c71e
15:29:03 Removing intermediate container 354c0e63c71e
15:29:03  ---> ce5e7d1acba9
15:29:03 Step 12/25 : ENV CONFIG_KEY="${CONFIG_KEY}"
15:29:03  ---> Running in 5d3985455a7e
15:29:03 Removing intermediate container 5d3985455a7e
15:29:03  ---> b3ac919c847a
15:29:03 Step 13/25 : COPY package-lock.json /app
15:29:03  ---> 4e2313dfd425
15:29:03 Step 14/25 : COPY package.json /app
15:29:03  ---> cd964a7bc9eb
15:29:03 Step 15/25 : RUN npm ci;
15:29:04  ---> Running in 34d5f411ed99
15:29:33 
15:29:33 > uws@0.14.5 install /app/node_modules/uws
15:29:33 > node-gyp rebuild > build_log.txt 2>&1 || exit 0
15:29:33 
15:29:47 
15:29:47 > axe-core@2.6.1 postinstall /app/node_modules/protractor-accessibility-plugin/node_modules/axe-core
15:29:47 > node build/utils/postinstall.js
15:29:47 
15:29:47 
15:29:47 > fsevents@1.2.7 install /app/node_modules/pm2/node_modules/fsevents
15:29:47 > node install
15:29:47 
15:29:48 
15:29:48 > dtrace-provider@0.8.7 install /app/node_modules/dtrace-provider
15:29:48 > node-gyp rebuild || node suppress-error.js
15:29:48 
15:29:48 make: Entering directory '/app/node_modules/dtrace-provider/build'
15:29:48   TOUCH Release/obj.target/DTraceProviderStub.stamp
15:29:48 make: Leaving directory '/app/node_modules/dtrace-provider/build'
15:29:48 
15:29:48 > protobufjs@6.8.8 postinstall /app/node_modules/protobufjs
15:29:48 > node scripts/postinstall
15:29:48 
15:29:48 
15:29:48 > grpc@1.15.1 install /app/node_modules/grpc
15:29:48 > node-pre-gyp install --fallback-to-build --library=static_library
15:29:48 
15:29:49 [91mnode-pre-gyp[0m[91m [0m[91mWARN[0m[91m [0m[91mUsing request for node-pre-gyp https download 
15:29:49 [0m[grpc] Success: "/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl/grpc_node.node" is installed via remote
15:29:49 
15:29:49 > wd@1.11.2 install /app/node_modules/wd
15:29:49 > node scripts/build-browser-scripts
15:29:49 
15:29:50 
15:29:50 > husky@0.14.3 install /app/node_modules/husky
15:29:50 > node ./bin/install.js
15:29:50 
15:29:50 husky
15:29:50 setting up Git hooks
15:29:50 can't find .git directory, skipping Git hooks installation
15:29:50 
15:29:50 > fsevents@1.2.4 install /app/node_modules/fsevents
15:29:50 > node install
15:29:50 
15:29:50 
15:29:50 > nodemon@1.18.3 postinstall /app/node_modules/nodemon
15:29:50 > node bin/postinstall || exit 0
15:29:50 
15:29:50 [91m(node:8) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
15:29:50 [0m[32mLove nodemon? You can now support the project via the open collective:[22m[39m
15:29:50  > [96m[1mhttps://opencollective.com/nodemon/donate[0m
15:29:50 
15:29:50 
15:29:50 > fsevents@1.2.9 install /app/node_modules/glob-watcher/node_modules/fsevents
15:29:50 > node install
15:29:50 
15:29:50 
15:29:50 > core-js-pure@3.1.3 postinstall /app/node_modules/core-js-pure
15:29:50 > node scripts/postinstall || echo "ignore"
15:29:50 
15:29:51 [96mThank you for using core-js ([94m https://github.com/zloirock/core-js [96m) for polyfilling JavaScript standard library![0m
15:29:51 
15:29:51 [96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: [0m
15:29:51 [96m>[94m https://opencollective.com/core-js [0m
15:29:51 [96m>[94m https://www.patreon.com/zloirock [0m
15:29:51 
15:29:51 [96mAlso, the author of core-js ([94m https://github.com/zloirock [96m) is looking for a good job -)[0m
15:29:51 
15:29:51 [91madded 3525 packages in 45.699s
15:29:51 [0munknown parent image ID sha256:cd964a7bc9eb57e51b914e282113748a236591ffc886ae58be5d38cb42342b9b
15:30:30 Build step 'Execute shell' marked build as failure
15:30:31 Finished: FAILURE
1 Like

I am also getting the same error msg. Were you able to resolve it ? @isurfbecause

No, I have not. I had to create a new Jenkins Slave with the newest docker version to NOT experience that error.

Ohk Thanks @isurfbecause. I was also thinking to upgrade docker on that machine. I faced the issue 2 times then I have not faced it again till now.

Yes that problem is intermittent and hard to reproduce. Upgrading was my only solution.

On my side, this was because I was cleaning my Docker Host machine with docker system prune.
This cleans all dangling images etc.
Nevertheless, this also removed intermediate images used during the build (one intermediate image per layer/step).

Is there a way to use docker system prune without removing intermediate images used by docker build. I didn’t find any filter in the doc.

Use the –no-cache tag in the build command line.

docker build --no-cache -t dockerimagenew:v1 .