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

使用Dockerfile和docker-compose.yaml部署项目失败 #121

Open
cubale opened this issue Apr 14, 2024 · 6 comments
Open

使用Dockerfile和docker-compose.yaml部署项目失败 #121

cubale opened this issue Apr 14, 2024 · 6 comments

Comments

@cubale
Copy link

cubale commented Apr 14, 2024

按照DEVELOPMENT.md中的指南,先后在一个文件夹下创建Dockerfile和docker-compose.yaml两个文件,复制了相应的内容,然后通过docker-compose up命令创建容器。

运行程序,在build镜像的过程中出错,错误信息如下:
[+] Building 8.7s (10/14)
=> [internal] load build definition from Dockerfile 0.4s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.5s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/node:20-alpine3.16 2.1s
=> [base 1/4] FROM docker.io/library/node:20-alpine3.16@sha256:f9b54b46639a9017b39eba677cf44c8cb967 0.0s
=> [internal] load build context 0.3s
=> => transferring context: 662B 0.0s
=> CACHED [base 2/4] RUN corepack enable 0.0s
=> [base 3/4] COPY . /app 0.4s
=> [base 4/4] WORKDIR /app 0.6s
=> ERROR [prod-deps 1/2] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --fr 3.5s
=> CANCELED [build 1/2] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lo 4.4s

[prod-deps 1/2] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile --ignore-scripts:
#0 3.215 Internal Error: Error when performing the request
#0 3.215 at ClientRequest. (/usr/local/lib/node_modules/corepack/dist/corepack.js:43953:14)
#0 3.215 at ClientRequest.emit (node:events:511:28)
#0 3.215 at TLSSocket.socketErrorListener (node:_http_client:495:9)
#0 3.215 at TLSSocket.emit (node:events:511:28)
#0 3.215 at emitErrorNT (node:internal/streams/destroy:151:8)
#0 3.215 at emitErrorCloseNT (node:internal/streams/destroy:116:3)
#0 3.215 at process.processTicksAndRejections (node:internal/process/task_queues:82:21)


failed to solve: executor failed running [/bin/sh -c pnpm install --prod --frozen-lockfile --ignore-scripts]: exit code: 1`

出现错误,导致无法完成镜像的编译,后面也就没法部署。
从错误信息看不出什么原因的。

@meetqy
Copy link
Owner

meetqy commented Apr 16, 2024

image 把这个注释取消了试试

@cubale
Copy link
Author

cubale commented Apr 16, 2024

@meetqy
您好,我是docker部署,不是本地运行,所有不知道您说的取消那处注释该如何实现。
我又在openwrt的docker环境下运行了docker compose up,结果报如下错误:
image

@ZhangYiQiu
Copy link

image 把这个注释取消了试试

不起作用

@ghost
Copy link

ghost commented May 22, 2024

按照DEVELOPMENT.md中的指南,先后在一个文件夹下创建Dockerfile和docker-compose.yaml两个文件,复制了相应的内容,然后通过docker-compose up命令创建容器。

运行程序,在build镜像的过程中出错,错误信息如下:

[+] Building 8.7s (10/14)
=> [internal] load build definition from Dockerfile 0.4s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.5s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/node:20-alpine3.16 2.1s
=> [base 1/4] FROM docker.io/library/node:20-alpine3.16@sha256:f9b54b46639a9017b39eba677cf44c8cb967 0.0s
=> [internal] load build context 0.3s
=> => transferring context: 662B 0.0s
=> CACHED [base 2/4] RUN corepack enable 0.0s
=> [base 3/4] COPY . /app 0.4s
=> [base 4/4] WORKDIR /app 0.6s
=> ERROR [prod-deps 1/2] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --fr 3.5s
=> CANCELED [build 1/2] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lo 4.4s

[prod-deps 1/2] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile --ignore-scripts:
#0 3.215 Internal Error: Error when performing the request
#0 3.215 at ClientRequest. (/usr/local/lib/node_modules/corepack/dist/corepack.js:43953:14)
#0 3.215 at ClientRequest.emit (node:events:511:28)
#0 3.215 at TLSSocket.socketErrorListener (node:_http_client:495:9)
#0 3.215 at TLSSocket.emit (node:events:511:28)
#0 3.215 at emitErrorNT (node:internal/streams/destroy:151:8)
#0 3.215 at emitErrorCloseNT (node:internal/streams/destroy:116:3)
#0 3.215 at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

failed to solve: executor failed running [/bin/sh -c pnpm install --prod --frozen-lockfile --ignore-scripts]: exit code: 1`

出现错误,导致无法完成镜像的编译,后面也就没法部署。 从错误信息看不出什么原因的。

你需要将整个项目clone下来 然后 docker-compose up

@yeyinghai
Copy link

不行啊,我是整个clone下来也是和你一样的错误

@liguobao
Copy link

@meetqy 您好,我是docker部署,不是本地运行,所有不知道您说的取消那处注释该如何实现。 我又在openwrt的docker环境下运行了docker compose up,结果报如下错误: image

你这个错误是因为拉不到镜像。

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

5 participants