ci(Dockerfile): 使用缓存优化apk安装速度

使用--mount=type=cache参数缓存apk包,减少重复构建时的下载时间
This commit is contained in:
zhouyonggao 2025-11-28 17:11:35 +08:00
parent 2debbdd116
commit dd736bc927
2 changed files with 19 additions and 1 deletions

View File

@ -1,6 +1,6 @@
FROM golang:1.21-alpine AS build
WORKDIR /app
RUN apk add --no-cache build-base
RUN --mount=type=cache,target=/var/cache/apk apk add build-base
COPY server/ ./server/
COPY web/ ./web/
WORKDIR /app/server

18
log/server-20251128.log Normal file
View File

@ -0,0 +1,18 @@
connecting YMT MySQL: : db user
connecting Marketing MySQL: : db user
YMT MySQL DSN missing: host, port, user, name required
connecting YMT MySQL: : db user
connecting Marketing MySQL: : db user
YMT MySQL DSN missing: host, port, user, name required
connecting YMT MySQL: : db user
connecting Marketing MySQL: : db user
YMT MySQL DSN missing: host, port, user, name required
connecting YMT MySQL: : db user
connecting Marketing MySQL: : db user
YMT MySQL DSN missing: host, port, user, name required
connecting YMT MySQL: : db user
connecting Marketing MySQL: : db user
YMT MySQL DSN missing: host, port, user, name required
connecting YMT MySQL: : db user
connecting Marketing MySQL: : db user
YMT MySQL DSN missing: host, port, user, name required