File tree Expand file tree Collapse file tree 3 files changed +32
-9
lines changed Expand file tree Collapse file tree 3 files changed +32
-9
lines changed Original file line number Diff line number Diff line change 1
1
include :
2
2
- .cnb/workflows/vscode.yml
3
3
- .cnb/workflows/release.yml
4
- - .cnb/workflows/sync-to-github.yml
4
+ - .cnb/workflows/sync-to-github.yml
5
+ - .cnb/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
1
+ main :
2
+ push :
3
+ - runner :
4
+ cpus : 16
5
+ services :
6
+ - docker
7
+ - git-clone-yyds
8
+ stages :
9
+ - name : 🐋 推送镜像
10
+ script : |
11
+ docker run -d --name buildkitd \
12
+ --security-opt seccomp=unconfined \
13
+ --security-opt apparmor=unconfined \
14
+ --security-opt systempaths=unconfined \
15
+ moby/buildkit:rootless
16
+ docker buildx create --use \
17
+ --name mybuilder \
18
+ --driver remote docker-container://buildkitd
19
+ docker buildx build \
20
+ -t ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE} \
21
+ --platform=linux/arm64,linux/amd64 . --push
Original file line number Diff line number Diff line change 1
- FROM node:14.18 AS builder
1
+ # 此 Dockerfile 仅用于构建可复制的 dist 内容,并不包含运行环境
2
+ # 第一阶段构建不区分平台,可通过指定 --platform=linux/amd64 来声明环境
3
+ FROM --platform=linux/amd64 docker.cnb.cool/znb/images/node:18 AS builder
2
4
3
- RUN mkdir /app
4
- ADD . /app/
5
5
WORKDIR /app
6
+
7
+ ADD . .
8
+
6
9
RUN sed -i 's@http://localhost:8888/@/@g' .env.production \
7
10
&& git config --global url."https://" .insteadOf git:// \
8
11
&& npm install --registry=http://registry.npmmirror.com \
9
12
&& yarn build:prod
10
13
11
- FROM openresty/openresty:1.21.4.1-0-centos7
12
- RUN mkdir /app
14
+ FROM docker.cnb.cool/znb/images/alpine
15
+
13
16
WORKDIR /app
14
- COPY --from=builder /app/default.conf /etc/nginx/conf.d/default.conf
15
- COPY --from=builder /app/dist .
16
17
17
- CMD nginx -g "daemon off;"
18
+ COPY --from=builder /app/dist/ dist/
You can’t perform that action at this time.
0 commit comments