File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ ARG TAGS="sqlite sqlite_unlock_notify"
99ENV TAGS="bindata timetzdata $TAGS"
1010ARG CGO_EXTRA_CFLAGS
1111
12+ ARG GOCACHE
13+ ENV GOCACHE=${GOCACHE:-/root/.cache/go-build}
14+
15+ ARG GOMODCACHE
16+ ENV GOMODCACHE=${GOMODCACHE:-/go/pkg/mod}
17+
1218# Build deps
1319RUN apk --no-cache add \
1420 build-base \
@@ -23,10 +29,17 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
2329
2430# Checkout version if set
2531RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}" ; fi \
26- && make clean-all build
32+ && make clean-all
33+
34+ RUN --mount=type=cache,target=/root/.npm \
35+ --mount=type=cache,target=/go/pkg/mod/ \
36+ --mount=type=cache,target="/root/.cache/go-build" \
37+ make build
2738
2839# Begin env-to-ini build
29- RUN go build contrib/environment-to-ini/environment-to-ini.go
40+ RUN --mount=type=cache,target=/go/pkg/mod/ \
41+ --mount=type=cache,target="/root/.cache/go-build" \
42+ go build contrib/environment-to-ini/environment-to-ini.go
3043
3144# Copy local files
3245COPY docker/root /tmp/local
Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ ARG TAGS="sqlite sqlite_unlock_notify"
99ENV TAGS="bindata timetzdata $TAGS"
1010ARG CGO_EXTRA_CFLAGS
1111
12+ ARG GOCACHE
13+ ENV GOCACHE=${GOCACHE:-/root/.cache/go-build}
14+
15+ ARG GOMODCACHE
16+ ENV GOMODCACHE=${GOMODCACHE:-/go/pkg/mod}
17+
1218#Build deps
1319RUN apk --no-cache add \
1420 build-base \
@@ -23,10 +29,17 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
2329
2430# Checkout version if set
2531RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
26- && make clean-all build
32+ && make clean-all
33+
34+ RUN --mount=type=cache,target=/root/.npm \
35+ --mount=type=cache,target=/go/pkg/mod/ \
36+ --mount=type=cache,target="/root/.cache/go-build" \
37+ make build
2738
2839# Begin env-to-ini build
29- RUN go build contrib/environment-to-ini/environment-to-ini.go
40+ RUN --mount=type=cache,target=/go/pkg/mod/ \
41+ --mount=type=cache,target="/root/.cache/go-build" \
42+ go build contrib/environment-to-ini/environment-to-ini.go
3043
3144# Copy local files
3245COPY docker/rootless /tmp/local
You can’t perform that action at this time.
0 commit comments