为什么选择云效DevOps
之前在本地小主机(4C4G)构建镜像,本地发布一切正常。但是第一次在云服务器(2C2G)上打包构建博客项目时出现内存不足错误。
=> ERROR [builder 7/7] RUN npm run docs:build 55.9s
------
> [builder 7/7] RUN npm run docs:build:
1.861
1.861 > vuepress-theme-hope-template@2.0.0 docs:build
1.861 > vuepress-webpack build src
1.861
5.905 - Initializing and preparing data
21.13 ✔ Initializing and preparing data - done in 15.23s
21.13 - Compiling with webpack
54.63
54.63 <--- Last few GCs --->
54.63
54.63 [18:0x56d68b0] 50525 ms: Scavenge 984.0 (1007.1) -> 983.2 (1011.6) MB, 6.7 / 0.0 ms (average mu = 0.362, current mu = 0.327) allocation failure;
54.63 [18:0x56d68b0] 52704 ms: Mark-sweep (reduce) 986.5 (1011.6) -> 984.6 (1006.6) MB, 1402.4 / 0.0 ms (+ 309.2 ms in 52 steps since start of marking, biggest step 18.9 ms, walltime since start of marking 1750 ms) (average mu = 0.287, current mu = 0.235) a
54.63
54.63 <--- JS stacktrace --->
54.63
54.64 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
54.70 1: 0xb9c1f0 node::Abort() [node]
54.71 2: 0xaa27ee [node]
54.71 3: 0xd73950 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
54.72 4: 0xd73cf7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
54.72 5: 0xf51075 [node]
54.72 6: 0xf6354d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
54.72 7: 0xf3dc3e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
54.73 8: 0xf3f007 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
54.74 9: 0xf2020a v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
54.74 10: 0x12e543f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
54.75 11: 0x17120b9 [node]
55.51 Aborted (core dumped)
------
Dockerfile:11
--------------------
9 |
10 | COPY . .
11 | >>> RUN npm run docs:build
12 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run docs:build" did not complete successfully: exit code: 134