-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update 优化 Dockerfile layer #101
base: master
Are you sure you want to change the base?
Conversation
eamonzzz
commented
Jul 13, 2022
- 优化 Dockerfile layer
- 更新 node 版本
- 减少安装包和镜像大小
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在构建 1.12.0 已经不行,会报以下的报错
yarn run v1.22.19 $ NODE_ENV=production ykit pack -m (node:134) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency (Use
node --trace-warnings ...` to show where the warning was created)
(node:134) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
[error] .//recharts/lib/polyfill.js/recharts/lib/polyfill.js 3:0-26
Module not found: Error: Cannot resolve module 'core-js/es/math' in /yapi/vendors/node_modules/recharts/lib
@ ./
[error] .//recharts/lib/polyfill.js/recharts/lib/polyfill.js 5:0-28
Module not found: Error: Cannot resolve module 'core-js/es/number' in /yapi/vendors/node_modules/recharts/lib
@ ./
[error] ../config.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at JSON.parse ()
at Object.module.exports (/yapi/vendors/node_modules/json-loader/index.js:4:49)
@ ./server/yapi.js 12:13-41
[error] .//fs-extra/lib/empty/index.js/fs-extra/lib/empty/index.js 4:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/fs-extra/lib/empty
@ ./
[error] .//nodemailer/lib/mailer/index.js/nodemailer/lib/mailer/index.js 13:12-26
Module not found: Error: Cannot resolve module 'net' in /yapi/vendors/node_modules/nodemailer/lib/mailer
@ ./
[error] .//nodemailer/lib/mailer/index.js/nodemailer/lib/mailer/index.js 14:12-26
Module not found: Error: Cannot resolve module 'dns' in /yapi/vendors/node_modules/nodemailer/lib/mailer
@ ./
[error] .//nodemailer/lib/shared/index.js/nodemailer/lib/shared/index.js 5:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/nodemailer/lib/shared
@ ./
[error] .//nodemailer/lib/sendmail-transport/index.js/nodemailer/lib/sendmail-transport/index.js 3:14-38
Module not found: Error: Cannot resolve module 'child_process' in /yapi/vendors/node_modules/nodemailer/lib/sendmail-transport
@ ./
[error] .//nodemailer/lib/smtp-connection/http-proxy-client.js/nodemailer/lib/smtp-connection/http-proxy-client.js 7:12-26
Module not found: Error: Cannot resolve module 'net' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/smtp-connection/index.js/nodemailer/lib/smtp-connection/index.js 5:12-26
Module not found: Error: Cannot resolve module 'net' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/smtp-connection/http-proxy-client.js/nodemailer/lib/smtp-connection/http-proxy-client.js 8:12-26
Module not found: Error: Cannot resolve module 'tls' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/smtp-connection/index.js/nodemailer/lib/smtp-connection/index.js 6:12-26
Module not found: Error: Cannot resolve module 'tls' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/dkim/index.js/nodemailer/lib/dkim/index.js 10:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/nodemailer/lib/dkim
@ ./
[error] .//graceful-fs/graceful-fs.js/graceful-fs/graceful-fs.js 1:9-22
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/graceful-fs
@ ./
[error] .//nodemailer/lib/mime-node/index.js/nodemailer/lib/mime-node/index.js 7:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/nodemailer/lib/mime-node
@ ./
[error] .//jsonfile/index.js/jsonfile/index.js 5:8-21
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/jsonfile
@ ./
[error] index@5e1419cd3b8ee11ed4be.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [../~/fs-extra/lib/util/assign.js:5,0]
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn && node /yapi/scripts/clean.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在构建 1.12.0 已经不行,会报以下的报错
yarn run v1.22.19 $ NODE_ENV=production ykit pack -m (node:134) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency (Use
node --trace-warnings ...` to show where the warning was created)
(node:134) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:134) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
[error] .//recharts/lib/polyfill.js/recharts/lib/polyfill.js 3:0-26
Module not found: Error: Cannot resolve module 'core-js/es/math' in /yapi/vendors/node_modules/recharts/lib
@ ./
[error] .//recharts/lib/polyfill.js/recharts/lib/polyfill.js 5:0-28
Module not found: Error: Cannot resolve module 'core-js/es/number' in /yapi/vendors/node_modules/recharts/lib
@ ./
[error] ../config.json
Module build failed: SyntaxError: Unexpected token m in JSON at position 0
at JSON.parse ()
at Object.module.exports (/yapi/vendors/node_modules/json-loader/index.js:4:49)
@ ./server/yapi.js 12:13-41
[error] .//fs-extra/lib/empty/index.js/fs-extra/lib/empty/index.js 4:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/fs-extra/lib/empty
@ ./
[error] .//nodemailer/lib/mailer/index.js/nodemailer/lib/mailer/index.js 13:12-26
Module not found: Error: Cannot resolve module 'net' in /yapi/vendors/node_modules/nodemailer/lib/mailer
@ ./
[error] .//nodemailer/lib/mailer/index.js/nodemailer/lib/mailer/index.js 14:12-26
Module not found: Error: Cannot resolve module 'dns' in /yapi/vendors/node_modules/nodemailer/lib/mailer
@ ./
[error] .//nodemailer/lib/shared/index.js/nodemailer/lib/shared/index.js 5:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/nodemailer/lib/shared
@ ./
[error] .//nodemailer/lib/sendmail-transport/index.js/nodemailer/lib/sendmail-transport/index.js 3:14-38
Module not found: Error: Cannot resolve module 'child_process' in /yapi/vendors/node_modules/nodemailer/lib/sendmail-transport
@ ./
[error] .//nodemailer/lib/smtp-connection/http-proxy-client.js/nodemailer/lib/smtp-connection/http-proxy-client.js 7:12-26
Module not found: Error: Cannot resolve module 'net' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/smtp-connection/index.js/nodemailer/lib/smtp-connection/index.js 5:12-26
Module not found: Error: Cannot resolve module 'net' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/smtp-connection/http-proxy-client.js/nodemailer/lib/smtp-connection/http-proxy-client.js 8:12-26
Module not found: Error: Cannot resolve module 'tls' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/smtp-connection/index.js/nodemailer/lib/smtp-connection/index.js 6:12-26
Module not found: Error: Cannot resolve module 'tls' in /yapi/vendors/node_modules/nodemailer/lib/smtp-connection
@ ./
[error] .//nodemailer/lib/dkim/index.js/nodemailer/lib/dkim/index.js 10:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/nodemailer/lib/dkim
@ ./
[error] .//graceful-fs/graceful-fs.js/graceful-fs/graceful-fs.js 1:9-22
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/graceful-fs
@ ./
[error] .//nodemailer/lib/mime-node/index.js/nodemailer/lib/mime-node/index.js 7:11-24
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/nodemailer/lib/mime-node
@ ./
[error] .//jsonfile/index.js/jsonfile/index.js 5:8-21
Module not found: Error: Cannot resolve module 'fs' in /yapi/vendors/node_modules/jsonfile
@ ./
[error] index@5e1419cd3b8ee11ed4be.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [../~/fs-extra/lib/util/assign.js:5,0]
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn && node /yapi/scripts/clean.js