简体   繁体   English

Vapor 不会通过 Docker 在 DigitalOcean 上构建

[英]Vapor won't build on DigitalOcean via Docker

I have a Vapor app which I'd like to deploy on DigitalOcean.我有一个想在 DigitalOcean 上部署的 Vapor 应用程序。 The Vapor documentation suggests creating a droplet (and then setting up it manually including cloning from GitHub). Vapor 文档建议创建一个 droplet(然后手动设置它,包括从 GitHub 克隆)。 But I'd like to have DC deploy my project automatically - so I created an app instead of droplet.但我想让 DC 自动部署我的项目 - 所以我创建了一个应用程序而不是 droplet。 Unfortunately it won't build:(不幸的是它不会建立:(

Here's what I see in the logs (stripped):这是我在日志中看到的(剥离):

[2022-07-28 21:17:13] => Initializing build
[2022-07-28 21:17:13] => Retrieving source code to /.app_platform_workspace
[2022-07-28 21:17:13] => Selecting branch "master"
[2022-07-28 21:17:13] => Checking out commit "86d8078be01b1bd38412c8657bb935cb0e8381ed"
[2022-07-28 21:17:14] => Got source_dir: /
[2022-07-28 21:17:14] => Using workspace root /.app_platform_workspace
[2022-07-28 21:17:14] => Got dockerfile_path: Dockerfile
[2022-07-28 21:17:14] 
[2022-07-28 21:17:14] => Building app using Dockerfile
[2022-07-28 21:17:15] => Using Dockerfile: /.app_platform_workspace/Dockerfile
[2022-07-28 21:17:15] => Using build context /.app_platform_workspace//
[2022-07-28 21:17:15] 
[2022-07-28 21:17:16] INFO[0000] Resolved base name swift:5.6-focal to build  
...
[2022-07-28 21:19:34] INFO[0139] Running: [/bin/sh -c swift package resolve]  
[2022-07-28 21:19:38] 'build': warning: failed storing manifest for 'build' in cache: disk I/O error
[2022-07-28 21:19:38] warning: failed loading cached manifest for 'build': disk I/O error
[2022-07-28 21:19:38] INFO[0143] Pushed <registry-uri-6> 
...
[2022-07-28 21:19:39] [1/1143] Fetching objects
[2022-07-28 21:19:40] Fetched https://github.com/vapor/leaf.git (1.40s)
...
[2022-07-28 21:20:02] warning: failed loading cached manifest for 'leaf': disk I/O error
...
[2022-07-28 21:21:38] 'leaf': warning: failed loading cached manifest for 'leaf': disk I/O error
...                             
[2022-07-28 21:23:08] INFO[0352] args: [-c swift build -c release --static-swift-stdlib] 
[2022-07-28 21:23:08] INFO[0352] Running: [/bin/sh -c swift build -c release --static-swift-stdlib] 
[2022-07-28 21:23:15] 'build': warning: failed loading cached manifest for 'build': disk I/O error
[2022-07-28 21:23:19] 'vapor': warning: failed loading cached manifest for 'vapor': disk I/O error
[2022-07-28 21:23:19] 'fluent-postgres-driver': warning: failed loading cached manifest for 'fluent-postgres-driver': disk I/O error
[2022-07-28 21:23:19] 'leaf': warning: failed loading cached manifest for 'leaf': disk I/O error
...
[2022-07-28 21:24:22] Building for production...
[2022-07-28 21:24:25] [1/875] Compiling _NumericsShims _NumericsShims.c
[2022-07-28 21:24:25] [2/875] Compiling CNIOWindows WSAStartup.c
[2022-07-28 21:24:25] [3/875] Compiling CNIOWindows shim.c
[2022-07-28 21:24:26] [4/875] Compiling CVaporBcrypt bcrypt.c
[2022-07-28 21:24:26] [5/875] Compiling CVaporURLParser urlparser.c
[2022-07-28 21:24:26] [6/875] Compiling CVaporBcrypt blf.c
[2022-07-28 21:24:26] [7/875] Compiling CNIOLinux liburing_shims.c
[2022-07-28 21:24:28] remark: Incremental compilation has been disabled: it is not compatible with whole module optimizationerror: invalid driver name: swift-driver[8/875] Compiling CNIOSHA1 c_nio_sha1.c
[2022-07-28 21:24:28] [9/875] Compiling CNIOLinux shim.c
[2022-07-28 21:24:28] [10/875] Compiling CNIOExtrasZlib empty.c
[2022-07-28 21:24:28] [11/875] Compiling CNIODarwin shim.c
[2022-07-28 21:24:28] [11/875] Compiling tls_record.cc
[2022-07-28 21:24:28] [12/875] Compiling sha1-armv8.ios.aarch64.S
[2022-07-28 21:24:28] [13/875] Compiling sha1-armv8.linux.aarch64.S
[2022-07-28 21:24:28] [14/875] Compiling CBacktrace backtrace.c
[2022-07-28 21:24:28] [15/875] Compiling CBacktrace dwarf.c
[2022-07-28 21:24:28] [16/875] Compiling CBacktrace mmap.c
[2022-07-28 21:24:28] [17/875] Compiling CBacktrace atomic.c
[2022-07-28 21:24:28] [18/875] Compiling CAsyncHTTPClient CAsyncHTTPClient.c
[2022-07-28 21:24:28] [18/875] Compiling CNIOBoringSSLShims shims.c
[2022-07-28 21:24:28] [18/875] Compiling CNIOHTTPParser c_nio_http_parser.c
[2022-07-28 21:24:33] remark: Incremental compilation has been disabled: it is not compatible with whole module optimizationerror building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
[2022-07-28 21:24:33] 
[2022-07-28 21:24:33] command exited with code 1
[2022-07-28 21:24:48]  ! Build failed (exit code 1)

Could you please explain what's wrong here?你能解释一下这里有什么问题吗?

The Swift compiler is running out of memory and helpfully crashing without any error message. Swift 编译器已用完 memory 并在没有任何错误消息的情况下崩溃。 You need to compile on something that provides more memory to the build machines, either by specking it higher or using GitHub actions to build it.您需要编译为构建机器提供更多 memory 的东西,方法是指定它更高或使用 GitHub 操作来构建它。 This is a known issue with digital ocean and Swift这是数字海洋和 Swift 的已知问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM