Skip to content

Commit 525ffc2

Browse files
committed
add COPY comment
1 parent 1d5345d commit 525ffc2

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.dockerignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ cpu.out
7474
/VERSION
7575
/.air
7676
/.go-licenses
77-
Dockerfile
78-
Dockerfile.rootless
77+
/Dockerfile
78+
/Dockerfile.rootless
7979

8080
# Files and folders that were previously generated
8181
/public/assets/img/webpack

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ RUN apk --no-cache add \
1717
pnpm
1818

1919
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
20+
# Use COPY but not "mount" because some directories like "node_modules" contain platform-depended contents and these directories need to be ignored.
21+
# ".git" directory will be mounted later separately for getting version data.
22+
# TODO: in the future, maybe we can pre-build the frontend assets on one platform and share them for different platforms, the benefit is that it won't be affected by webpack plugin compatibility problems, then the working directory can be fully mounted and the COPY is not needed.
2023
COPY --exclude=.git/ . .
2124

2225
# Build gitea, .git mount is required for version data
@@ -40,7 +43,7 @@ FROM docker.io/library/alpine:3.22 AS gitea
4043

4144
EXPOSE 22 3000
4245

43-
RUN apk add --no-cache \
46+
RUN apk --no-cache add \
4447
bash \
4548
ca-certificates \
4649
curl \
@@ -66,7 +69,7 @@ RUN addgroup \
6669
echo "git:*" | chpasswd -e
6770

6871
COPY --from=build-env /tmp/local /
69-
COPY --chmod=755 --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
72+
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
7073

7174
ENV USER=git
7275
ENV GITEA_CUSTOM=/data/gitea

Dockerfile.rootless

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN apk --no-cache add \
1717
pnpm
1818

1919
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
20+
# See the comments in Dockerfile
2021
COPY --exclude=.git/ . .
2122

2223
# Build gitea, .git mount is required for version data
@@ -61,7 +62,7 @@ RUN mkdir -p /var/lib/gitea /etc/gitea
6162
RUN chown git:git /var/lib/gitea /etc/gitea
6263

6364
COPY --from=build-env /tmp/local /
64-
COPY --from=build-env --chmod=755 --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
65+
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
6566

6667
# git:git
6768
USER 1000:1000

docker/root/usr/local/bin/gitea

100755100644
File mode changed.

docker/rootless/usr/local/bin/gitea

100755100644
File mode changed.

0 commit comments

Comments
 (0)