Skip to content

Commit 4563148

Browse files
galibozekzeripath
andauthored
Upgrade Alpine from 3.13 to 3.15 (#18050)
* Upgrade alpine to 3.15 * Add executability test to entrypoint for too old dockers Signed-off-by: Andrew Thornton <art27@cantab.net> * Update docker/rootless/usr/local/bin/docker-entrypoint.sh Co-authored-by: zeripath <art27@cantab.net>
1 parent b7c6457 commit 4563148

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

Dockerfile

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
###################################
3-
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4-
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
1+
#Build stage
2+
FROM golang:1.17-alpine3.15 AS build-env
53

64
ARG GOPROXY
75
ENV GOPROXY ${GOPROXY:-direct}
@@ -25,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2523
# Begin env-to-ini build
2624
RUN go build contrib/environment-to-ini/environment-to-ini.go
2725

28-
FROM alpine:3.13
26+
FROM alpine:3.15
2927
LABEL maintainer="maintainers@gitea.io"
3028

3129
EXPOSE 22 3000

Dockerfile.rootless

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
###################################
3-
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4-
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
1+
#Build stage
2+
FROM golang:1.17-alpine3.15 AS build-env
53

64
ARG GOPROXY
75
ENV GOPROXY ${GOPROXY:-direct}
@@ -25,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2523
# Begin env-to-ini build
2624
RUN go build contrib/environment-to-ini/environment-to-ini.go
2725

28-
FROM alpine:3.13
26+
FROM alpine:3.15
2927
LABEL maintainer="maintainers@gitea.io"
3028

3129
EXPOSE 2222 3000

docker/root/usr/bin/entrypoint

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/sh
22

3+
# Protect against buggy runc in docker <20.10.6 causing problems in with Alpine >= 3.14
4+
if [ ! -x /bin/sh ]; then
5+
echo "Executable test for /bin/sh failed. Your Docker version is too old to run Alpine 3.14+ and Gitea. You must upgrade Docker.";
6+
exit 1;
7+
fi
8+
39
if [ "${USER}" != "git" ]; then
410
# rename user
511
sed -i -e "s/^git\:/${USER}\:/g" /etc/passwd

docker/rootless/usr/local/bin/docker-entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/sh
22

3+
# Protect against buggy runc in docker <20.10.6 causing problems in with Alpine >= 3.14
4+
if [ ! -x /bin/sh ]; then
5+
echo "Executable test for /bin/sh failed. Your Docker version is too old to run Alpine 3.14+ and Gitea. You must upgrade Docker.";
6+
exit 1;
7+
fi
8+
39
if [ -x /usr/local/bin/docker-setup.sh ]; then
410
/usr/local/bin/docker-setup.sh || { echo 'docker setup failed' ; exit 1; }
511
fi

0 commit comments

Comments
 (0)