Unable to run with Docker
ddanilyuk opened this issue · 2 comments
ddanilyuk commented
Hi! I am getting an error after adding this library to generated by vapor new
project with fluent+postgre
.
This error does not appears with docker compose build
but, after running docker compose up
I got this:
$ docker compose up
[+] Running 2/2
⠿ Container testpointfree-db-1 Created 0.0s
⠿ Container testpointfree-app-1 Recreated 0.1s
Attaching to testpointfree-app-1, testpointfree-db-1
testpointfree-db-1 |
testpointfree-db-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
testpointfree-db-1 |
testpointfree-db-1 | 2022-05-24 13:57:41.910 UTC [1] LOG: starting PostgreSQL 14.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
testpointfree-db-1 | 2022-05-24 13:57:41.911 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
testpointfree-db-1 | 2022-05-24 13:57:41.911 UTC [1] LOG: listening on IPv6 address "::", port 5432
testpointfree-db-1 | 2022-05-24 13:57:41.914 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
testpointfree-db-1 | 2022-05-24 13:57:41.920 UTC [22] LOG: database system was shut down at 2022-05-24 13:51:55 UTC
testpointfree-db-1 | 2022-05-24 13:57:41.933 UTC [1] LOG: database system is ready to accept connections
testpointfree-app-1 | ./Run: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
testpointfree-app-1 exited with code 127
My Package.swift
:
// swift-tools-version:5.6
import PackageDescription
let package = Package(
name: "TestPointfree",
platforms: [
.macOS(.v12)
],
dependencies: [
// 💧 A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
.package(url: "https://github.com/vapor/fluent.git", from: "4.0.0"),
.package(url: "https://github.com/vapor/fluent-postgres-driver.git", from: "2.0.0"),
.package(url: "https://github.com/pointfreeco/vapor-routing", from: "0.1.0"),
],
targets: [
.target(
name: "App",
dependencies: [
.product(name: "Fluent", package: "fluent"),
.product(name: "FluentPostgresDriver", package: "fluent-postgres-driver"),
.product(name: "Vapor", package: "vapor"),
.product(name: "VaporRouting", package: "vapor-routing"),
],
swiftSettings: [
// Enable better optimizations when building in Release configuration. Despite the use of
// the `.unsafeFlags` construct required by SwiftPM, this flag is recommended for Release
// builds. See <https://github.com/swift-server/guides/blob/main/docs/building.md#building-for-production> for details.
.unsafeFlags(["-cross-module-optimization"], .when(configuration: .release))
]
),
.executableTarget(name: "Run", dependencies: [.target(name: "App")]),
.testTarget(name: "AppTests", dependencies: [
.target(name: "App"),
.product(name: "XCTVapor", package: "vapor"),
])
]
)
Project without this library runs as expected.
finestructure commented
I think you're missing curl in your Dockerfile:
RUN apt-get update && apt-get install -y curl
ddanilyuk commented
I think you're missing curl in your Dockerfile:
RUN apt-get update && apt-get install -y curl
Thanks it's working.