apache / apache/answer-plugins

Docker build with plugin from answer base image always gets stuck here and does not proceed.

Đang mở
#242 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
131
Fork
75
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

when I build with plugin in docker. the docker file like this:
```
# 第一阶段:使用 answer-builder 构建 answer
FROM apache/answer as answer-builder

# 第二阶段:使用 golang 构建插件和新的 answer
FROM golang:1.19-alpine AS golang-builder

# 设置国内 Go 模块代理
ENV GOPROXY=https://goproxy.cn,direct

# 复制 answer 可执行文件
# set alpine linux 代理
COPY --from=answer-builder /usr/bin/answer /usr/bin/answer
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

# 安装构建所需依赖和 pnpm
RUN apk --no-cache add \
build-base git bash nodejs npm go && \
npm config set registry https://registry.npmmirror.com && \
npm install -g pnpm@8.9.2 && \
pnpm config set registry https://registry.npmmirror.com && \
echo "Dependencies installed successfully"

# 增加 npm 和 pnpm 的超时时间和重试次数
RUN npm config set fetch-retries 5 && \
npm config set fetch-retry-mintimeout 20000 && \
npm config set fetch-retry-maxtimeout 120000 && \
pnpm config set fetch-retries 5 && \
pnpm config set fetch-retry-mintimeout 20000 && \
pnpm config set fetch-retry-maxtimeout 120000

# 启用缓存机制,避免重复下载依赖
RUN npm config set cache /root/.npm-cache --global && \
pnpm config set store-dir /root/.pnpm-store

# 强制更新 Browserslist 数据库,使用国内的 npm 镜像
RUN npm config set registry https://registry.npmmirror.com && \
npx update-browserslist-db@latest || true

# 使用 answer build 构建插件并输出新的 answer
RUN answer build \
--with github.com/apache/incubator-answer-plugins/user-center-wecom \
--output /usr/bin/new_answer \
&& ls -l /usr/bin/new_answer

# 第三阶段:最终构建镜像
FROM alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
LABEL maintainer="linkinstar@apache.org"

# 设置默认时区为 Asia/Shanghai
ARG TIMEZONE
ENV TIMEZONE=${TIMEZONE:-"Asia/Shanghai"}

# 安装基础依赖和设置时区
RUN apk update \
&& apk --no-cache add \
bash \
ca-certificates \
curl \
dumb-init \
gettext \
openssh \
sqlite \
gnupg \
tzdata \
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone

# 复制新构建的 answer 可执行文件和其他必要文件
COPY --from=golang-builder /usr/bin/new_answer /usr/bin/answer
COPY --from=answer-builder /data /data
COPY --from=answer-builder /entrypoint.sh /entrypoint.sh

# 设置 entrypoint 脚本的执行权限
RUN chmod 755 /entrypoint.sh

# 挂载 /data 目录
VOLUME /data

# 暴露 80 端口
EXPOSE 80

# 设置 entrypoint
ENTRYPOINT ["/entrypoint.sh"]
````

the process always stuck here.

```
=> [answer golang-builder 8/8] RUN answer build --with github.com/apache/incubator-answer-plugins/user-center-wecom --output /usr/bin/new_answer && ls -l /usr/bin/new_answer 1302.2s
=> => # > answer-static@0.1.0 build /go/answer_build43967365/vendor/github.com/apache/incubator-answer/ui
=> => # > node ./scripts/env.js && react-app-rewired build
=> => # Creating an optimized production build...
=> => # Browserslist: caniuse-lite is outdated. Please run:
=> => # npx update-browserslist-db@latest
=> => # Why you should do it regularly: https://github.com/browserslist/update-db#readme
```
Because I am in China, so reference to the official configuration file, I have added a lot of proxy settings, does this have anything to do with the unsuccessful build?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Tái hiện Dockerfile nhiều giai đoạn được cung cấp và bắt đầu từ entry point `answer build --with ... --output /usr/bin/new_answer`. So sánh đầu ra của quá trình build xung quanh `answer-static` và `react-app-rewired build`, sau đó xác minh rằng lệnh hoàn tất và `/usr/bin/new_answer` được tạo thay vì bị treo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, go, node.js
Lĩnh vực
build-system, devops
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.