Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59175

java.io.IOException: Cannot retrieve .Id from 'docker inspect node:latest AS build-env'

    Details

    • Similar Issues:

      Description

      I am getting error Angular project Dockerfile pipeline building details given below, solution to the problem appreciated-

      #############

          1. build ###
            #############
      1. base image
      2. FROM node:latest as builder
        FROM node:latest AS build-env
      1. Creating app directory in Docker server
      2. mkdir /app
      1. set working directory
        WORKDIR /app
      1. add `/app/node_modules/.bin` to $PATH
      2. ENV PATH /app/node_modules/.bin:$PATH
      1. install and cache app dependencies
        COPY package.json /app/package.json
      1. install and cache app dependencies
        RUN npm install
      1. add app
        COPY . /app
      1. run tests
      2. RUN ng test --watch=false
      3. run e2e test
      4. RUN ng e2e --port 4202
      1. generate build
        RUN npm run build – --output-path=./dist
      1. copy artifact build from the 'build environment'
        COPY --from=build-env /app/dist  .

      I am getting error :

       

      Removing intermediate container f3c2c71b3482 Successfully built a26ef673d681 Successfully tagged koreatrade_dev_web:latest [Pipeline] dockerFingerprintFrom [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline java.io.IOException: Cannot retrieve .Id from 'docker inspect node:latest AS build-env' at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:220) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:133) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:85) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:267) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1143) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:618) at java.lang.Thread.run(Thread.java:785) Finished: FAILURE

      I tried

      1. base image
      2. FROM node:latest as builder
        FROM node as base

      and

      1. copy artifact build from the 'build environment'
        COPY --from=0 /app/dist  .

      Is giving error like :
      Step 7/7 : COPY --from=0 /app/dist .
      invalid from flag value 0: refers to current build stage
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code 1
      Finished: FAILURE

       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              sumantakarmakar Sumanta Karmakar
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: