Skip to content

Commit 0b636c7

Browse files
committed
Add more recent distributions to docker configs and fix locale setup
* Add an early check for the locale * locale-gen does not take an argument on Debian (only on Ubuntu), and on Debian all locales are commented by default, even en_US.UTF-8. * See https://stackoverflow.com/a/28406007/388803 and https://stackoverflow.com/a/41648500/388803 * oraclelinux:8-slim does not have yum, only microdnf * glibc-langpack-en is needed to set the locale
1 parent f78385f commit 0b636c7

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

tool/docker-configs.yaml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,66 @@
1-
rpm_packages: &rpm_packages
2-
locale:
1+
rpm: &rpm
32
tar: tar gzip
43
specs: which findutils
54
zlib: zlib-devel
65
openssl: openssl-devel
76
cext: gcc make
7+
set-locale:
8+
- ENV LANG=en_US.UTF-8
89

9-
deb_packages: &deb_packages
10+
deb: &deb
1011
locale: locales
1112
tar:
1213
specs: netbase
1314
zlib: libz-dev
1415
openssl: libssl-dev
1516
cext: gcc make
17+
set-locale:
18+
# Uncomment the en_US.UTF-8 line in /etc/locale.gen
19+
- RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
20+
# locale-gen generates locales for all uncommented locales in /etc/locale.gen
21+
- RUN locale-gen
22+
- ENV LANG=en_US.UTF-8
1623

1724
ol7:
1825
base: oraclelinux:7-slim
19-
set-locale:
20-
- ENV LANG=en_US.UTF-8
2126
install: RUN yum install -y
22-
<<: *rpm_packages
27+
locale:
28+
<<: *rpm
29+
30+
ol8:
31+
base: oraclelinux:8-slim
32+
install: RUN microdnf install -y
33+
locale: glibc-langpack-en
34+
<<: *rpm
2335

2436
fedora28:
2537
base: fedora:28
26-
set-locale:
27-
- ENV LANG=en_US.UTF-8
2838
install: RUN dnf install -y
29-
<<: *rpm_packages
39+
locale:
40+
<<: *rpm
41+
42+
fedora34:
43+
base: fedora:34
44+
install: RUN dnf install -y
45+
locale: glibc-langpack-en
46+
<<: *rpm
47+
48+
ubuntu2004:
49+
base: ubuntu:20.04
50+
install: RUN apt-get update && apt-get install -y
51+
<<: *deb
3052

3153
ubuntu1804:
3254
base: ubuntu:18.04
33-
set-locale:
34-
- RUN locale-gen en_US.UTF-8
35-
- ENV LANG=en_US.UTF-8
3655
install: RUN apt-get update && apt-get install -y
37-
<<: *deb_packages
56+
<<: *deb
3857

3958
ubuntu1604:
4059
base: ubuntu:16.04
41-
set-locale:
42-
- RUN locale-gen en_US.UTF-8
43-
- ENV LANG=en_US.UTF-8
4460
install: RUN apt-get update && apt-get install -y
45-
<<: *deb_packages
61+
<<: *deb
62+
63+
debian10:
64+
base: debian:buster
65+
install: RUN apt-get update && apt-get install -y
66+
<<: *deb

tool/docker.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ def docker(*args)
128128
*distro.fetch('set-locale'),
129129
]
130130

131+
# Check the locale is properly generated
132+
lines << 'RUN locale -a | grep en_US.utf8'
133+
131134
lines << 'WORKDIR /test'
132135

133136
lines << 'RUN useradd -ms /bin/bash test'

0 commit comments

Comments
 (0)