Skip to content

Commit 1d5345d

Browse files
committed
restore chmod for windows based builds
1 parent 449d2b4 commit 1d5345d

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ cpu.out
7676
/.go-licenses
7777
Dockerfile
7878
Dockerfile.rootless
79+
7980
# Files and folders that were previously generated
8081
/public/assets/img/webpack
8182

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ RUN --mount=type=cache,target=/go/pkg/mod \
2626
--mount=type=bind,source=".git/",target=".git/" \
2727
make
2828

29+
COPY docker/root /tmp/local
30+
31+
# Set permissions for builds that made under windows which strips the executable bit from file
32+
RUN chmod 755 /tmp/local/usr/bin/entrypoint \
33+
/tmp/local/usr/local/bin/* \
34+
/tmp/local/etc/s6/gitea/* \
35+
/tmp/local/etc/s6/openssh/* \
36+
/tmp/local/etc/s6/.s6-svscan/* \
37+
/go/src/code.gitea.io/gitea/gitea
38+
2939
FROM docker.io/library/alpine:3.22 AS gitea
3040

3141
EXPOSE 22 3000
@@ -55,7 +65,7 @@ RUN addgroup \
5565
git && \
5666
echo "git:*" | chpasswd -e
5767

58-
COPY docker/root /
68+
COPY --from=build-env /tmp/local /
5969
COPY --chmod=755 --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
6070

6171
ENV USER=git

Dockerfile.rootless

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ RUN --mount=type=cache,target=/go/pkg/mod \
2626
--mount=type=bind,source=".git/",target=".git/" \
2727
make
2828

29+
COPY docker/rootless /tmp/local
30+
31+
# Set permissions for builds that made under windows which strips the executable bit from file
32+
RUN chmod 755 /tmp/local/usr/local/bin/* \
33+
/go/src/code.gitea.io/gitea/gitea
34+
2935
FROM docker.io/library/alpine:3.22 AS gitea-rootless
3036

3137
EXPOSE 2222 3000
@@ -54,7 +60,7 @@ RUN addgroup \
5460
RUN mkdir -p /var/lib/gitea /etc/gitea
5561
RUN chown git:git /var/lib/gitea /etc/gitea
5662

57-
COPY docker/rootless /
63+
COPY --from=build-env /tmp/local /
5864
COPY --from=build-env --chmod=755 --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
5965

6066
# git:git

0 commit comments

Comments
 (0)