Build failing even in condition that worked the last time

The automated build that we have configured is not working anymore.
We suspected the last version of Alpine to be the issue so we downgraded our base image to node:16-alpine3.13 but the issue is still there.
Then we tried to downgrade to an image that worked on the last build (node:16.3.0-alpine3.13) and the issue is still there.

The same Dockerfile is used in Github Actions for our staging repo and the build is completed.

Cloning into '.'...

Warning: Permanently added the RSA host key for IP address '*.*.*.*' to the list of known hosts.

Switched to a new branch '*'

Pulling cache layers for index.docker.io/*/*:latest...

Done!

KernelVersion: 4.4.0-1060-aws

Components: [{u'Version': u'19.03.8', u'Name': u'Engine', u'Details': {u'KernelVersion': u'4.4.0-1060-aws', u'Os': u'linux', u'BuildTime': u'2020-03-11T01:24:30.000000000+00:00', u'ApiVersion': u'1.40', u'MinAPIVersion': u'1.12', u'GitCommit': u'afacb8b7f0', u'Arch': u'amd64', u'Experimental': u'false', u'GoVersion': u'go1.12.17'}}, {u'Version': u'1.2.13', u'Name': u'containerd', u'Details': {u'GitCommit': u'7ad184331fa3e55e52b890ea95e65ba581ae3429'}}, {u'Version': u'1.0.0-rc10', u'Name': u'runc', u'Details': {u'GitCommit': u'dc9208a3303feef5b3839f4323d9beb36df0a9dd'}}, {u'Version': u'0.18.0', u'Name': u'docker-init', u'Details': {u'GitCommit': u'fec3683'}}]

Arch: amd64

BuildTime: 2020-03-11T01:24:30.000000000+00:00

ApiVersion: 1.40

Platform: {u'Name': u'Docker Engine - Community'}

Version: 19.03.8

MinAPIVersion: 1.12

GitCommit: afacb8b7f0

Os: linux

GoVersion: go1.12.17

Buildkit: Starting build for index.docker.io/*/*:latest...

WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release

#2 importing cache manifest from index.docker.io/*/*:latest

#2 DONE 0.0s

#3 [internal] load build definition from Dockerfile

#3 transferring dockerfile: 786B done

#3 DONE 0.0s

#1 [internal] load .dockerignore

#1 transferring context: 2B done

#1 DONE 0.0s

#4 [internal] load metadata for docker.io/library/node:16.3.0-alpine3.13

#4 DONE 0.5s

#4 [internal] load metadata for docker.io/library/node:16.3.0-alpine3.13

#4 DONE 0.5s

#5 [build 1/11] FROM docker.io/library/node:16.3.0-alpine3.13@sha256:2eee2f...

#5 resolve docker.io/library/node:16.3.0-alpine3.13@sha256:2eee2f439d3b3509bbe40faff6584bd31b5745b4c137e93e2d795899a2927762 done

#5 sha256:2eee2f439d3b3509bbe40faff6584bd31b5745b4c137e93e2d795899a2927762 1.43kB / 1.43kB done

#5 sha256:f5079a4f93c8e4fd07ffa93fc95f6484d7f4f40abd126c11810cb282483ab599 1.16kB / 1.16kB done

#5 sha256:48de5d16038cc532b2b5ef91f8d1028f5542b8196f5c6eced9c172894a7af337 6.73kB / 6.73kB done

#5 DONE 0.1s

#7 [internal] load build context

#7 transferring context: 515.01kB 0.1s done

#7 DONE 0.1s

#6 [build 2/11] WORKDIR /app

#6 DONE 0.0s

#8 [build 3/11] COPY package.json .

#8 DONE 0.1s

#9 [build 4/11] RUN npm install -g npm@latest

#9 21.47

#9 21.47 removed 1 package, changed 31 packages, and audited 257 packages in 20s

#9 21.47

#9 21.47 11 packages are looking for funding

#9 21.47 run `npm fund` for details

#9 21.47

#9 21.47 found 0 vulnerabilities

#9 21.47 npm notice

#9 21.47 npm notice New minor version of npm available! 7.15.1 -> 7.19.1

#9 21.47 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.19.1>

#9 21.47 npm notice Run `npm install -g npm@7.19.1` to update!

#9 21.47 npm notice

#9 DONE 21.6s

#10 [build 5/11] RUN npm install

#10 57.67

#10 57.67 added 1035 packages, and audited 1036 packages in 56s

#10 57.67

#10 57.67 67 packages are looking for funding

#10 57.67 run `npm fund` for details

#10 57.68

#10 57.68 found 0 vulnerabilities

#10 DONE 57.9s

#11 [build 6/11] COPY ./src ./src

#11 DONE 0.1s

#12 [build 7/11] COPY ./views ./views

#12 DONE 0.0s

#13 [build 8/11] COPY webpack.config.* ./

#13 DONE 0.1s

#14 [build 9/11] COPY .sequelizerc .

#14 DONE 0.1s

#15 [build 10/11] COPY sequelize.config.json .

#15 DONE 0.1s

#16 [build 11/11] RUN npm run build-prod

#16 1.359

#16 1.359 > @*/*@* build-prod

#16 1.359 > npm run build-db && npm run build-server && npm run build-client && npm run build-styles-prod && npm run build-cli

#16 1.359

#16 1.936

#16 1.936 > @*/*@* build-db

#16 1.936 > npm run clean-db-folder && tsc --build ./src/database/tsconfig.json

#16 1.936

#16 2.526

#16 2.526 > @*/*@* clean-db-folder

#16 2.526 > del-cli --force ./database/*

#16 2.526

#16 27.52

#16 27.52 > @*/*@* build-server

#16 27.52 > npx webpack --config webpack.config.server.js

#16 27.52

#16 51.26 asset application.js 40.5 KiB [emitted] [minimized] (name: application)

#16 51.26 orphan modules 84.1 KiB [orphan] 34 modules

#16 51.26 runtime modules 663 bytes 3 modules

#16 51.26 built modules 86 KiB [built]

#16 51.26 modules by path ./ 85.9 KiB

#16 51.26 cacheable modules 1.31 KiB

#16 51.26 ./src/database/models/index.ts 973 bytes [built] [code generated]

#16 51.26 ./sequelize.config.json 367 bytes [built] [code generated]

#16 51.26 ./src/server/application.ts + 34 modules 84.4 KiB [not cacheable] [built] [code generated]

#16 51.26 ./src/database/models/ sync 160 bytes [built] [code generated]

#16 51.26 external "path" 42 bytes [built] [code generated]

#16 51.26 external "fs" 42 bytes [built] [code generated]

#16 51.26 external "sequelize" 42 bytes [built] [code generated]

#16 51.26

#16 51.26 WARNING in ./src/database/models/index.ts 22:18-53

#16 51.26 Critical dependency: the request of a dependency is an expression

#16 51.26 @ ./src/server/*.ts 11:15-44

#16 51.26 @ ./src/server/*.ts 1:0-45 3:22-33

#16 51.26

#16 51.26 1 warning has detailed information that is not shown.

#16 51.26 Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

#16 51.26

#16 51.26 webpack 5.44.0 compiled with 1 warning in 21621 ms

#16 51.93

#16 51.93 > @*/*@* build-client

#16 51.93 > npx webpack --config webpack.config.js

#16 51.93

#16 84.90 asset schedule-page-service.js 146 KiB [emitted] [minimized] (name: schedule-page-service)

#16 84.90 orphan modules 307 KiB [orphan] 69 modules

#16 84.90 ./src/client/services/*.ts + 69 modules 322 KiB [built] [code generated]

#16 84.90 webpack 5.44.0 compiled successfully in 31187 ms

#16 85.59

#16 85.59 > @*/*@* build-styles-prod

#16 85.59 > sass --no-source-map views/sass:public/styles/

#16 85.59

#16 87.53

#16 87.53 > @*/*@* build-cli

#16 87.53 > tsc --build ./src/cli/tsconfig.json

#16 87.53

#16 DONE 111.6s

#17 [stage-1 3/13] COPY --from=build /app/dist /app/dist

#17 DONE 0.1s

#18 [stage-1 4/13] COPY --from=build /app/public /app/public

#18 DONE 0.1s

#19 [stage-1 5/13] COPY --from=build /app/views /app/views

#19 DONE 0.1s

#20 [stage-1 6/13] COPY --from=build /app/database /app/database

#20 DONE 0.1s

#21 [stage-1 7/13] COPY --from=build /app/.sequelizerc /app/

#21 DONE 0.1s

#22 [stage-1 8/13] COPY --from=build /app/sequelize.config.json /app/

#22 DONE 0.1s

#23 [stage-1 9/13] RUN rm $(find . -name *.scss)

#23 DONE 0.9s

#24 [stage-1 10/13] COPY package.json .

#24 DONE 0.0s

#25 [stage-1 11/13] COPY ./assets ./assets

#25 DONE 0.0s

#26 [stage-1 12/13] RUN npm install -g npm@latest

#26 19.40

#26 19.40 removed 1 package, changed 31 packages, and audited 257 packages in 18s

#26 19.40

#26 19.40 11 packages are looking for funding

#26 19.40 run `npm fund` for details

#26 19.41

#26 19.41 found 0 vulnerabilities

#26 19.41 npm notice

#26 19.41 npm notice New minor version of npm available! 7.15.1 -> 7.19.1

#26 19.41 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.19.1>

#26 19.41 npm notice Run `npm install -g npm@7.19.1` to update!

#26 19.41 npm notice

#26 DONE 19.5s

#27 [stage-1 13/13] RUN npm install --only=production

#27 32.03

#27 32.03 added 229 packages, and audited 230 packages in 31s

#27 32.03

#27 32.03 5 packages are looking for funding

#27 32.03 run `npm fund` for details

#27 32.03

#27 32.03 found 0 vulnerabilities

#27 DONE 32.2s

failed to receive status: rpc error: code = Unavailable desc = transport is closing

Build failed using Buildkit

Here is the Dockerfile

FROM node:16.3.0-alpine3.13 AS build

WORKDIR /app

COPY package.json .

RUN npm install -g npm@latest

RUN npm install

COPY ./src ./src

COPY ./views ./views

COPY webpack.config.* ./

COPY .sequelizerc .

COPY sequelize.config.json .

RUN npm run build-prod

FROM node:16.3.0-alpine3.13

WORKDIR /app

COPY --from=build /app/dist /app/dist

COPY --from=build /app/public /app/public

COPY --from=build /app/views /app/views

COPY --from=build /app/database /app/database

COPY --from=build /app/.sequelizerc /app/

COPY --from=build /app/sequelize.config.json /app/

RUN rm $(find . -name *.scss)

COPY package.json .

COPY ./assets ./assets

RUN npm install -g npm@latest

RUN npm install --only=production

EXPOSE 3000

CMD [ "npm", "start" ]

It really seems that the build is succeeding at the end, since all the steps are completed. We are clueless for what to do to resolve this issue. Please help us.

1 Like

The same issue with node/next.js build.

Help please. :frowning:
If it can help, these are the next steps that appear when building the image locally:

exporting to image                                                                                             0.9s
=> exporting layers                                                                                            0.9s
=> writing image sha256:eb168ec65c144b299ad5183bad9483655285578fb99a2f81f615dabde9b13176                       0.0s

I am assuming that the issue is not with the Dockerfile but with DockerHub.

Hi mlarabi,

I’ve just disabled the build cache in the build settings and it works now.

Hope this will help.

Thanks,

Thank you very much. This solved the issue.

Hello,

I am having this exact issue. Although my build used to work fine, all of a sudden it stopped working. Now it fails on npm i because of some warnings. Any help, please?

Thanks!