Skip to content

Commit 449d2b4

Browse files
committed
remove checkout from container
1 parent 0551e5b commit 449d2b4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ RUN apk --no-cache add \
1919
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
2020
COPY --exclude=.git/ . .
2121

22-
# Checkout version if set
22+
# Build gitea, .git mount is required for version data
2323
RUN --mount=type=cache,target=/go/pkg/mod \
2424
--mount=type=cache,target="/root/.cache/go-build" \
2525
--mount=type=cache,target=/root/.local/share/pnpm/store \
2626
--mount=type=bind,source=".git/",target=".git/" \
27-
if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
28-
&& make
27+
make
2928

3029
FROM docker.io/library/alpine:3.22 AS gitea
3130

Dockerfile.rootless

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ RUN apk --no-cache add \
1919
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
2020
COPY --exclude=.git/ . .
2121

22-
# Checkout version if set
22+
# Build gitea, .git mount is required for version data
2323
RUN --mount=type=cache,target=/go/pkg/mod \
2424
--mount=type=cache,target="/root/.cache/go-build" \
2525
--mount=type=cache,target=/root/.local/share/pnpm/store \
2626
--mount=type=bind,source=".git/",target=".git/" \
27-
if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
28-
&& make
29-
27+
make
3028

3129
FROM docker.io/library/alpine:3.22 AS gitea-rootless
3230

0 commit comments

Comments
 (0)