History

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

Grzegorz Alibożek committed 4 years ago

Commit 45631481 parent b7c64574 files · +18 −10Browse files

Unified · Split

4 files
  1. Dockerfile +3 −5
  2. Dockerfile.rootless +3 −5
  3. docker/root/usr/bin/entrypoint +6 −0
  4. docker/rootless/usr/local/bin/docker-entrypoint.sh +6 −0
Dockerfile+3−5
@@ -1,7 +1,5 @@
1 1#Build stage
2###################################2FROM golang:1.17-alpine3.15 AS build-env
3#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4FROM techknowlogick/go:1.17-alpine3.13 AS build-env
5 3
6ARG GOPROXY4ARG GOPROXY
7ENV GOPROXY ${GOPROXY:-direct}5ENV GOPROXY ${GOPROXY:-direct}
@@ -25,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ · 17 unmodified lines
25# Begin env-to-ini build23# Begin env-to-ini build
26RUN go build contrib/environment-to-ini/environment-to-ini.go24RUN go build contrib/environment-to-ini/environment-to-ini.go
27 25
28FROM alpine:3.1326FROM alpine:3.15
29LABEL maintainer="maintainers@gitea.io"27LABEL maintainer="maintainers@gitea.io"
30 28
31EXPOSE 22 300029EXPOSE 22 3000
Dockerfile.rootless+3−5
@@ -1,7 +1,5 @@
1 1#Build stage
2###################################2FROM golang:1.17-alpine3.15 AS build-env
3#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4FROM techknowlogick/go:1.17-alpine3.13 AS build-env
5 3
6ARG GOPROXY4ARG GOPROXY
7ENV GOPROXY ${GOPROXY:-direct}5ENV GOPROXY ${GOPROXY:-direct}
@@ -25,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ · 17 unmodified lines
25# Begin env-to-ini build23# Begin env-to-ini build
26RUN go build contrib/environment-to-ini/environment-to-ini.go24RUN go build contrib/environment-to-ini/environment-to-ini.go
27 25
28FROM alpine:3.1326FROM alpine:3.15
29LABEL maintainer="maintainers@gitea.io"27LABEL maintainer="maintainers@gitea.io"
30 28
31EXPOSE 2222 300029EXPOSE 2222 3000
docker/root/usr/bin/entrypoint+6−0
@@ -1,5 +1,11 @@
1#!/bin/sh1#!/bin/sh
2 2
3# Protect against buggy runc in docker <20.10.6 causing problems in with Alpine >= 3.14
4if [ ! -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;
7fi
8
3if [ "${USER}" != "git" ]; then9if [ "${USER}" != "git" ]; then
4 # rename user10 # rename user
5 sed -i -e "s/^git\:/${USER}\:/g" /etc/passwd11 sed -i -e "s/^git\:/${USER}\:/g" /etc/passwd
docker/rootless/usr/local/bin/docker-entrypoint.sh+6−0
@@ -1,5 +1,11 @@
1#!/bin/sh1#!/bin/sh
2 2
3# Protect against buggy runc in docker <20.10.6 causing problems in with Alpine >= 3.14
4if [ ! -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;
7fi
8
3if [ -x /usr/local/bin/docker-setup.sh ]; then9if [ -x /usr/local/bin/docker-setup.sh ]; then
4 /usr/local/bin/docker-setup.sh || { echo 'docker setup failed' ; exit 1; }10 /usr/local/bin/docker-setup.sh || { echo 'docker setup failed' ; exit 1; }
5fi11fi