Skip to content
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

[Bug] Docker image for backend won't build #51

Open
Mikle-Bond opened this issue Sep 2, 2023 · 2 comments
Open

[Bug] Docker image for backend won't build #51

Mikle-Bond opened this issue Sep 2, 2023 · 2 comments

Comments

@Mikle-Bond
Copy link

Describe the bug

The docker outputs this error:

------
 > [build_image 6/8] RUN npx prisma generate:
#0 5.585 Prisma schema loaded from prisma/schema.prisma
#0 7.555 Error: Get Config: Unable to establish a connection to query-engine-node-api library.
#0 7.555 Details: Unable to require(`/app/node_modules/prisma/libquery_engine-linux-musl.so.node`)
#0 7.555  Error loading shared library libssl.so.1.1: No such file or directory (needed by /app/node_modules/prisma/libquery_engine-linux-musl.so.node)
#0 7.555
#0 7.555 Prisma CLI Version : 4.2.0
------
failed to solve: process "/bin/sh -c npx prisma generate" did not complete successfully: exit code: 1                                                                                                    

I found this issue to be helpful: prisma/prisma#9624

I managed to build the image and spin up the project by changing BUILD_IMAGE to node:14.17.1-alpine, as suggested in one of the comments.

diff --git a/server/Dockerfile b/server/Dockerfile
index 34a14c0..80a753d 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:16-alpine AS BUILD_IMAGE
+FROM node:14.17.1-alpine AS BUILD_IMAGE
 
 
 # install dependencies
@@ -24,4 +24,4 @@ COPY --from=0 /app .
 ENV PORT 8080
 EXPOSE 8080
 
-CMD ["node", "./build/src/server.js"]
\ No newline at end of file
+CMD ["node", "./build/src/server.js"]

I find this strange, as that issue was marked as resolved back in 2021.

Environment (please complete the following information):

  • OS: VMware Photon OS 5.0
  • Docker 24.0.5 (docker version listing below)
Client:
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.12
 Git commit:        0ed913b8-
 Built:             07/28/2020 16:36:03
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       a61e2b4
  Built:            Fri Aug  4 19:22:45 2023
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 crun:
  Version:          1.8
  GitCommit:        0356bf4aff9a133d655dc13b1d9ac9424706cac4
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
@Marlon154
Copy link

@Mikle-Bond thanks alot this save my day!

@RFlintstone
Copy link

@Mikle-Bond Interestingly enough, I don't have this issue on FROM node:16-alpine AS BUILD_IMAGE. However I do seem to have the following:

Error: Could not find Prisma Schema that is required for this command.
You can either provide it with `--schema` argument, set it as `prisma.schema` in your package.json or put it into the default location.
Checked following paths:
schema.prisma: file not found
prisma/schema.prisma: file not found
prisma/schema: directory not found
See also https://pris.ly/d/prisma-schema-location

I'm not sure which is causing this as 'migrate' says the following:

Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "db.sqlite" at "file:/database/db.sqlite"
11 migrations found in prisma/migrations
No pending migrations to apply.

Seemingly without any apply history. (I'm trying to run it on a K3S cluster so it's definitely possible that, that's the issue.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants