Skip to content

Commit 0d98a27

Browse files
k8s-infra-cherrypick-robotdependabot[bot]Gacko
authored
Images: Bump Alpine to v3.21. (#12528)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marco Ebert <[email protected]>
1 parent fe6d1b7 commit 0d98a27

File tree

14 files changed

+35
-19
lines changed

14 files changed

+35
-19
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ clean-chroot-image: ## Removes local image
110110

111111
.PHONY: build
112112
build: ## Build ingress controller, debug tool and pre-stop hook.
113-
E2E_IMAGE=golang:$(GO_VERSION)-alpine3.20 USE_SHELL=/bin/sh build/run-in-docker.sh \
113+
E2E_IMAGE=golang:$(GO_VERSION)-alpine3.21 USE_SHELL=/bin/sh build/run-in-docker.sh \
114114
MAC_OS=$(MAC_OS) \
115115
PKG=$(PKG) \
116116
ARCH=$(ARCH) \

docs/examples/customization/sysctl/patch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"spec": {
55
"initContainers": [{
66
"name": "sysctl",
7-
"image": "alpine:3.20",
7+
"image": "alpine:3.21",
88
"securityContext": {
99
"privileged": true
1010
},

images/cfssl/rootfs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM alpine:3.20
15+
FROM alpine:3.21
1616

1717
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
1818
RUN apk update \

images/custom-error-pages/rootfs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
ARG GOLANG_VERSION
1616

17-
FROM golang:${GOLANG_VERSION}-alpine3.20 as builder
17+
FROM golang:${GOLANG_VERSION}-alpine3.21 as builder
1818

1919
RUN apk update \
2020
&& apk upgrade && apk add git

images/ext-auth-example-authsvc/rootfs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG GOLANG_VERSION
22

3-
FROM golang:${GOLANG_VERSION}-alpine3.20 as builder
3+
FROM golang:${GOLANG_VERSION}-alpine3.21 as builder
44
RUN mkdir /authsvc
55
WORKDIR /authsvc
66
COPY . ./

images/fastcgi-helloserver/rootfs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
ARG GOLANG_VERSION
1515

16-
FROM golang:${GOLANG_VERSION}-alpine3.20 as builder
16+
FROM golang:${GOLANG_VERSION}-alpine3.21 as builder
1717

1818
WORKDIR /go/src/k8s.io/ingress-nginx/images/fastcgi
1919

images/go-grpc-greeter-server/rootfs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG GOLANG_VERSION
22

3-
FROM golang:${GOLANG_VERSION}-alpine3.20 as build
3+
FROM golang:${GOLANG_VERSION}-alpine3.21 as build
44

55
WORKDIR /go/src/greeter-server
66

images/nginx/rootfs/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
FROM alpine:3.20 as builder
14+
FROM alpine:3.21 as builder
1515

1616
COPY . /
1717

@@ -21,7 +21,7 @@ RUN apk update \
2121
&& /build.sh
2222

2323
# Use a multi-stage build
24-
FROM alpine:3.20
24+
FROM alpine:3.21
2525

2626
ENV PATH=$PATH:/usr/local/luajit/bin:/usr/local/nginx/sbin:/usr/local/nginx/bin
2727

@@ -66,7 +66,7 @@ RUN apk update \
6666
); \
6767
for dir in "${writeDirs[@]}"; do \
6868
mkdir -p ${dir}; \
69-
chown -R www-data.www-data ${dir}; \
69+
chown -R www-data:www-data ${dir}; \
7070
done'
7171

7272
EXPOSE 80 443

images/nginx/rootfs/build.sh

+16-1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,21 @@ Include /etc/nginx/owasp-modsecurity-crs/rules/RESPONSE-980-CORRELATION.conf
414414
Include /etc/nginx/owasp-modsecurity-crs/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
415415
" > /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
416416

417+
# NGINX compiles a small test program to check if an added module works as expected.
418+
#
419+
# ModSecurity-nginx provides 'printf("hello");' as a test, but newer versions of GCC,
420+
# as included in Alpine 3.21, do not allow implicit declaration of function 'printf':
421+
#
422+
# objs/autotest.c:7:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
423+
#
424+
# For this reason we replace 'printf("hello");' by 'msc_init();', which is always available.
425+
#
426+
# This fix is taken from a PR, that has been proposed to the ModSecurity-nginx project:
427+
#
428+
# https://github.com/owasp-modsecurity/ModSecurity-nginx/pull/275
429+
#
430+
sed -i "s/ngx_feature_test='printf(\"hello\");'/ngx_feature_test='msc_init();'/" $BUILD_PATH/ModSecurity-nginx/config
431+
417432
# build nginx
418433
cd "$BUILD_PATH/nginx-$NGINX_VERSION"
419434

@@ -609,7 +624,7 @@ adduser -S -D -H -u 101 -h /usr/local/nginx -s /sbin/nologin -G www-data -g www-
609624

610625
for dir in "${writeDirs[@]}"; do
611626
mkdir -p ${dir};
612-
chown -R www-data.www-data ${dir};
627+
chown -R www-data:www-data ${dir};
613628
done
614629

615630
rm -rf /etc/nginx/owasp-modsecurity-crs/.git

images/test-runner/rootfs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ARG BASE_IMAGE
1515
ARG GOLANG_VERSION
1616
ARG ETCD_VERSION
1717

18-
FROM golang:${GOLANG_VERSION}-alpine3.20 as GO
18+
FROM golang:${GOLANG_VERSION}-alpine3.21 as GO
1919
FROM registry.k8s.io/etcd:${ETCD_VERSION} as etcd
2020

2121
FROM ${BASE_IMAGE}

rootfs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ RUN bash -xeu -c ' \
5959
); \
6060
for dir in "${writeDirs[@]}"; do \
6161
mkdir -p ${dir}; \
62-
chown -R www-data.www-data ${dir}; \
62+
chown -R www-data:www-data ${dir}; \
6363
done' \
6464
# LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules
6565
# Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below

rootfs/Dockerfile-chroot

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN apk update \
2323
&& apk upgrade \
2424
&& /chroot.sh
2525

26-
FROM alpine:3.20
26+
FROM alpine:3.21
2727

2828
ARG TARGETARCH
2929
ARG VERSION
@@ -78,7 +78,7 @@ RUN bash -xeu -c ' \
7878
); \
7979
for dir in "${writeDirs[@]}"; do \
8080
mkdir -p ${dir}; \
81-
chown -R www-data.www-data ${dir}; \
81+
chown -R www-data:www-data ${dir}; \
8282
done' \
8383
# LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules
8484
# Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below
@@ -103,7 +103,7 @@ RUN ln -sf /chroot/etc/nginx /etc/nginx \
103103
&& touch /chroot/var/log/nginx/access.log \
104104
&& chown www-data:www-data /chroot/var/log/nginx/access.log \
105105
&& echo "" > /chroot/etc/resolv.conf \
106-
&& chown -R www-data.www-data /chroot/var/log/nginx /chroot/etc/resolv.conf \
106+
&& chown -R www-data:www-data /chroot/var/log/nginx /chroot/etc/resolv.conf \
107107
&& mknod -m 0666 /chroot/dev/null c 1 3 \
108108
&& mknod -m 0666 /chroot/dev/random c 1 8 \
109109
&& mknod -m 0666 /chroot/dev/urandom c 1 9 \

rootfs/chroot.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ writeDirs=( \
3939

4040
for dir in "${writeDirs[@]}"; do
4141
mkdir -p ${dir};
42-
chown -R www-data.www-data ${dir};
42+
chown -R www-data:www-data ${dir};
4343
done
4444

4545
mkdir -p /chroot/lib /chroot/proc /chroot/usr /chroot/bin /chroot/dev /chroot/run
4646
cp /etc/passwd /etc/group /etc/hosts /chroot/etc/
4747
cp -a /usr/* /chroot/usr/
4848
cp -a /etc/nginx/* /chroot/etc/nginx/
4949
cp -a /etc/ingress-controller/* /chroot/etc/ingress-controller/
50-
cp /lib/ld-musl-* /lib/libcrypto* /lib/libssl* /lib/libz* /chroot/lib/
50+
cp /lib/ld-musl-* /chroot/lib/
51+
cp /usr/lib/libcrypto* /usr/lib/libssl* /usr/lib/libz* /chroot/usr/lib/

test/e2e-image/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG E2E_BASE_IMAGE
22
FROM ${E2E_BASE_IMAGE} AS BASE
33

4-
FROM alpine:3.20
4+
FROM alpine:3.21
55

66
RUN apk update \
77
&& apk upgrade && apk add -U --no-cache \

0 commit comments

Comments
 (0)