diff --git a/.drone.yml b/.drone.yml index a8fc12d..5824bda 100644 --- a/.drone.yml +++ b/.drone.yml @@ -93,6 +93,9 @@ volumes: path: /localcache/apps - name: npm-cache path: /localcache/npm-cache + - name: certs + host: + path: /localcache/registry_certs # 你提前放好 ca.crt clone: depth: 0 @@ -146,17 +149,19 @@ steps: image: registry.cn-beijing.aliyuncs.com/yinzy/drone-plugins:docker-latest pull: false settings: + volumes: + - name: certs + path: /etc/docker/certs.d/docker-registry.local:36000/ # 1. 仓库认证信息 - registry: - from_secret: local_registry_app_base_url + from_secret: local_registry_base_url username: from_secret: local_registry_user password: from_secret: local_registry_pass # 2. 镜像名称 (不包含 Tag) - repo: ${DRONE_REPO_NAME} + repo: /jk/apps/${DRONE_REPO_NAME}-front # 3. 指定 Dockerfile 位置 dockerfile: docker/Dockerfile-frontend @@ -170,9 +175,9 @@ steps: - front-${DRONE_TAG} # e.g. back-v1.0.0 - front-latest # 方便随时拉取最新版 # - front-${DRONE_COMMIT_SHA:0:8} - - # 6. (可选) 开启构建缓存,加速下次构建 - use_cache: true + # 如果你需要把 dist.tgz 复制给 build + extra_files: + - dist.tgz - name: docker_build image: docker:latest diff --git a/docker/Dockerfile b/docker/Dockerfile index 4810781..9afc0fd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # 使用最小的 Java 8 JRE 镜像 -FROM openjdk:8-jre-alpine +FROM docker-registry.local:36000/base/openjdk:8-jre-alpine # 设置工作目录 WORKDIR /app diff --git a/docker/Dockerfile-frontend b/docker/Dockerfile-frontend index df84b9c..ffe79a3 100644 --- a/docker/Dockerfile-frontend +++ b/docker/Dockerfile-frontend @@ -1,5 +1,5 @@ # 前端构建阶段 -FROM registry.cn-beijing.aliyuncs.com/yinzy/node:20.11-alpine3.19 AS builder +FROM docker-registry.local:36000/base/node:20.11-alpine3.19 AS builder WORKDIR /app @@ -15,7 +15,7 @@ COPY vue-ui/ . # RUN npm run build # 运行阶段,使用独立 nginx 镜像 -FROM registry.cn-beijing.aliyuncs.com/yinzy/nginx:alpine-stable AS runtime +FROM docker-registry.local:36000/base/nginx:alpine-stable AS runtime # 清理默认页面 WORKDIR /usr/share/nginx/html