Skip to content

Commit 9ef1b4b

Browse files
committed
Upgrade Alpine to 3.16 and Glibc to 2.35
1 parent fb1cec9 commit 9ef1b4b

File tree

5 files changed

+53
-46
lines changed

5 files changed

+53
-46
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image: docker:20
22
services:
3-
- docker:dind
3+
- docker:20-dind
44

55
variables:
66
GITLAB_TAG: $CI_REGISTRY_IMAGE
@@ -18,15 +18,16 @@ build:
1818
-v "${PWD}"/.hadolint.yaml:/.config/hadolint.yaml \
1919
hadolint/hadolint < Dockerfile-bin
2020
- docker build -t $GITLAB_TAG .
21+
- docker tag $GITLAB_TAG prantlf/alpine-glibc
2122
- docker build -t $GITLAB_TAG_BIN -f Dockerfile-bin .
23+
- docker tag $GITLAB_TAG_BIN prantlf/alpine-glibc:bin
2224
- docker tag $GITLAB_TAG $HUB_TAG
2325
- docker tag $GITLAB_TAG_BIN $HUB_TAG_BIN
2426
- echo -n "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
2527
- docker push $GITLAB_TAG
2628
- docker push $GITLAB_TAG_BIN
27-
- |
28-
mkdir -p $HOME/.docker
29-
echo '{ "auths": { "'https://index.docker.io/v1/'": { "auth": "'$DOCKER_AUTH'", "email": "prantlf@gmail.com" } } }' \
30-
> $HOME/.docker/config.json
29+
- echo -n "$DOCKER_TOKEN" | docker login -u prantlf --password-stdin
3130
- docker push $HUB_TAG
3231
- docker push $HUB_TAG_BIN
32+
except:
33+
- tags

Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM alpine:3.15
1+
FROM alpine:3.16
22
LABEL maintainer="Ferdinand Prantl <prantlf@gmail.com>"
33

44
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
5-
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-2.34-r0.apk && \
6-
apk update && apk add gzip glibc-2.34-r0.apk && \
5+
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk && \
6+
apk update && apk add gzip glibc-2.35-r0.apk && \
77
ln -sf /usr/glibc-compat/lib/ld-linux-x86-64.so.2 /usr/glibc-compat/lib/ld-linux-x86-64.so && \
88
ln -sf /usr/glibc-compat/lib/libBrokenLocale.so.1 /usr/glibc-compat/lib/libBrokenLocale.so && \
99
ln -sf /usr/glibc-compat/lib/libanl.so.1 /usr/glibc-compat/lib/libanl.so && \
@@ -22,14 +22,14 @@ RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/s
2222
ln -sf /usr/glibc-compat/lib/librt.so.1 /usr/glibc-compat/lib/librt.so && \
2323
ln -sf /usr/glibc-compat/lib/libthread_db.so.1 /usr/glibc-compat/lib/libthread_db.so && \
2424
ln -sf /usr/glibc-compat/lib/libutil.so.1 /usr/glibc-compat/lib/libutil.so && \
25-
rm glibc-2.34-r0.apk && \
26-
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-bin-2.34-r0.apk && \
27-
apk add glibc-bin-2.34-r0.apk && \
28-
rm glibc-bin-2.34-r0.apk && \
29-
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-i18n-2.34-r0.apk && \
30-
apk add glibc-i18n-2.34-r0.apk && \
31-
rm glibc-i18n-2.34-r0.apk /etc/apk/keys/sgerrand.rsa.pub && \
25+
rm glibc-2.35-r0.apk && \
26+
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk && \
27+
apk add glibc-bin-2.35-r0.apk && \
28+
rm glibc-bin-2.35-r0.apk && \
29+
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-i18n-2.35-r0.apk && \
30+
apk add glibc-i18n-2.35-r0.apk && \
31+
rm glibc-i18n-2.35-r0.apk /etc/apk/keys/sgerrand.rsa.pub && \
3232
gunzip --keep /usr/glibc-compat/share/i18n/charmaps/UTF-8.gz && \
3333
/usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 && \
34-
rm /usr/glibc-compat/share/i18n/charmaps/UTF-8 /var/cache/apk/* && \
35-
apk del glibc-bin glibc-i18n gzip
34+
apk del glibc-bin glibc-i18n gzip && \
35+
rm /usr/glibc-compat/share/i18n/charmaps/UTF-8 /var/cache/apk/*

Dockerfile-bin

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ FROM prantlf/alpine-glibc:latest
22
LABEL maintainer="Ferdinand Prantl <prantlf@gmail.com>"
33

44
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
5-
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-bin-2.34-r0.apk && \
6-
apk add glibc-bin-2.34-r0.apk && \
7-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/ldd && \
8-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/sotruss && \
9-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/tzselect && \
10-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/xtrace && \
11-
rm glibc-bin-2.34-r0.apk /etc/apk/keys/sgerrand.rsa.pub /var/cache/apk/*
5+
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk && \
6+
apk add --no-cache glibc-bin-2.35-r0.apk && \
7+
rm glibc-bin-2.35-r0.apk /etc/apk/keys/sgerrand.rsa.pub

Makefile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
clean ::
2-
docker image rm alpine-glibc
2+
docker image rm alpine-glibc alpine-glibc:bin prantlf/alpine-glibc prantlf/alpine-glibc:bin
33

44
lint ::
55
docker run --rm -i \
@@ -11,18 +11,37 @@ lint ::
1111

1212
build ::
1313
docker build -t alpine-glibc .
14+
docker tag alpine-glibc prantlf/alpine-glibc
1415
docker build -t alpine-glibc:bin -f Dockerfile-bin .
16+
docker tag alpine-glibc:bin prantlf/alpine-glibc:bin
1517

1618
run ::
1719
docker run --rm -t -i alpine-glibc
1820

19-
tag ::
20-
docker tag alpine-glibc prantlf/alpine-glibc
21-
docker tag alpine-glibc:bin prantlf/alpine-glibc:bin
22-
2321
login ::
2422
docker login --username=prantlf
23+
docker login registry.gitlab.com --username=prantlf
2524

2625
push ::
2726
docker push prantlf/alpine-glibc
2827
docker push prantlf/alpine-glibc:bin
28+
docker push registry.gitlab.com/prantlf/docker-alpine-glibc
29+
docker push registry.gitlab.com/prantlf/docker-alpine-glibc:bin
30+
31+
tag ::
32+
docker tag prantlf/alpine-glibc prantlf/alpine-glibc:3.16
33+
docker tag prantlf/alpine-glibc prantlf/alpine-glibc:3.16-2.35
34+
docker tag prantlf/alpine-glibc:bin prantlf/alpine-glibc:3.16-bin
35+
docker tag prantlf/alpine-glibc:bin prantlf/alpine-glibc:3.16-2.35-bin
36+
docker push prantlf/alpine-glibc:3.16
37+
docker push prantlf/alpine-glibc:3.16-2.35
38+
docker push prantlf/alpine-glibc:3.16-bin
39+
docker push prantlf/alpine-glibc:3.16-2.35-bin
40+
docker tag registry.gitlab.com/prantlf/docker-alpine-glibc registry.gitlab.com/prantlf/docker-alpine-glibc:3.16
41+
docker tag registry.gitlab.com/prantlf/docker-alpine-glibc registry.gitlab.com/prantlf/docker-alpine-glibc:3.16-2.35
42+
docker tag registry.gitlab.com/prantlf/docker-alpine-glibc:bin registry.gitlab.com/prantlf/docker-alpine-glibc:3.16-bin
43+
docker tag registry.gitlab.com/prantlf/docker-alpine-glibc:bin registry.gitlab.com/prantlf/docker-alpine-glibc:3.16-2.35-bin
44+
docker push registry.gitlab.com/prantlf/docker-alpine-glibc:3.16
45+
docker push registry.gitlab.com/prantlf/docker-alpine-glibc:3.16-2.35
46+
docker push registry.gitlab.com/prantlf/docker-alpine-glibc:3.16-bin
47+
docker push registry.gitlab.com/prantlf/docker-alpine-glibc:3.16-2.35-bin

README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ If you have trouble pulling the image from the Docker's default hub.docker.com,
1010

1111
Tags consist of versions of the Alpine Linux and GLIBC in this order, separated by a hyphen. The `latest` tag maps to the latest `<alpine>` tag. The latest `<alpine>` tag maps to the latest `<alpine>-<glibc>` tag. The `bin` and `<alpine>-bin` tags contain the `glibc-bin` package installed too.
1212

13-
- [`latest`], `bin`, `3.15`, `3.15-bin`, `3.14`, `3.14-2.34`, `3.14-2.33`, `3.13`, `3.12`
13+
- [`latest`], `bin`
14+
- `3.16`, `3.16-bin`, `3.16-2.35`
15+
- `3.15`, `3.15-bin`, `3.14`, `3.14-2.34`, `3.14-2.33`, `3.13`, `3.12`
1416

1517
## Install
1618

1719
```
1820
docker pull prantlf/alpine-glibc
19-
docker pull prantlf/alpine-glibc:3.15
21+
docker pull prantlf/alpine-glibc:3.16
2022
```
2123

2224
## Use
@@ -31,19 +33,6 @@ The final image can use the English locale by setting the environment variable `
3133

3234
See the [`git-p4` Docker image repository] for an example.
3335

34-
If you install `glibc-bin-2.34-r0.apk`, you will need to fix scripts that refer to `/usr/bin/bash`. For example:
35-
36-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/ldd
37-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/sotruss
38-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/tzselect
39-
sed -i 's#/usr/bin/bash#/bin/sh#' /usr/glibc-compat/bin/xtrace
40-
41-
Or you can create a symlink `bash` in `/usr/bin`:
42-
43-
ln -s /bin/sh /usr/bin/bash
44-
45-
The first way is used in this image tagged `bin` or `<alpine>-bin`.
46-
4736
If you install `glibc-i18n-2.34-r0.apk` and create a locale by `/usr/glibc-compat/bin/localedef`, you will need to unpack the charmap. For example:
4837

4938
gunzip --keep /usr/glibc-compat/share/i18n/charmaps/UTF-8.gz
@@ -61,12 +50,14 @@ The local image is built as `alpine-glibc` and pushed to the docker hub as `pran
6150
make build
6251
# Enter an interactive shell inside the created image:
6352
make run
64-
# Tag the local image for pushing:
65-
make tag
6653
# Login to the docker hub:
6754
make login
6855
# Push the local image to the docker hub:
6956
make push
57+
# Push the local image to the docker hub:
58+
make push
59+
# Add version tags to the published image:
60+
make tag
7061

7162
## License
7263

0 commit comments

Comments
 (0)