Skip to content

使用docker本地构建遇到报错 #131

@7hc

Description

@7hc

问题描述

执行如下命令,遇到报错,报错信息在补充信息中

  - name: 运行本地热榜服务器
    script: |
      # 进入临时目录
      mkdir /docker_tmp
      cd /docker_tmp
      # 拉取git
      git clone https://github.com/imsyy/DailyHotApi
      # 构建容器
      cd DailyHotApi
      docker build -t dailyhot-api .
      # 运行容器
      docker run --restart always -p 6688:6688 -d dailyhot-api

补充信息

#18 ERROR: process "/bin/sh -c pnpm build" did not complete successfully: exit code: 2
------
 > [builder 8/9] RUN pnpm build:
0.558 
0.558 > dailyhot-api@2.0.8 build /app
0.558 > tsc --project tsconfig.json
0.558 
11.40 src/routes/huxiu.ts(48,16): error TS2339: Property 'count_info' does not exist on type '{ object_id: number; content: string; url: string; user_info: { username: string; }; publish_time: string; }'.
11.45  ELIFECYCLE  Command failed with exit code 2.
------
Dockerfile:23
--------------------
  21 |     # 安装依赖
  22 |     RUN pnpm install
  23 | >>> RUN pnpm build
  24 |     RUN pnpm prune --production
  25 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c pnpm build" did not complete successfully: exit code: 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions