diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2023-01-25 16:43:25 +0100 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2023-01-26 11:26:06 +0000 |
| commit | 055cbf6876216d63f3f3cb8f3460d2409f9855d5 (patch) | |
| tree | 0287494d6e7b66472af1fc0b2561e7c6d402ce46 /docker/base | |
| parent | ff29af45d70bedfd76b30f015e9e4c68ca89bf59 (diff) | |
| download | kolla-055cbf6876216d63f3f3cb8f3460d2409f9855d5.tar.gz kolla-055cbf6876216d63f3f3cb8f3460d2409f9855d5.zip | |
Add util-linux to centos base packages
Currently /usr/sbin/nologin is missing, because util-linux
is not installed in the image.
Change-Id: I717b4f2215054ef9135a1ac252ed26820bdcb1aa
(cherry picked from commit 1371e4fc5b9d3d55f5bb48540753f740f1d1af02)
Diffstat (limited to 'docker/base')
| -rw-r--r-- | docker/base/Dockerfile.j2 | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 11a6547be..ccdd93d43 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -17,15 +17,6 @@ COPY curlrc /root/.curlrc ENV LANG en_US.UTF-8 {% endblock %} -{# NOTE(SamYaple): Avoid uid/gid conflicts by creating each user/group up front. #} -{# Specifics required such as homedir or shell are configured within the service specific image #} -{%- for name, user in users | dictsort() %} -{% if loop.first -%}RUN {% else %} && {% endif -%} - groupadd --gid {{ user.gid }} {{ user.group }} \ - && useradd -l -M --shell /usr/sbin/nologin --uid {{ user.uid }} --gid {{ user.gid }} {{ name }} - {%- if not loop.last %} \{% endif -%} -{%- endfor %} - LABEL kolla_version="{{ kolla_version }}" {% import "macros.j2" as macros with context %} @@ -203,6 +194,7 @@ RUN {{ macros.install_packages(base_centos_yum_repo_packages | customizable("cen 'socat', 'sudo', 'tar', + 'util-linux', 'util-linux-user', 'which' ] %} @@ -337,6 +329,15 @@ RUN apt-get --error-on=any update \ {# endif base_package_type deb #} {% endif %} +{# NOTE(SamYaple): Avoid uid/gid conflicts by creating each user/group up front. #} +{# Specifics required such as homedir or shell are configured within the service specific image #} +{%- for name, user in users | dictsort() %} +{% if loop.first -%}RUN {% else %} && {% endif -%} + groupadd --gid {{ user.gid }} {{ user.group }} \ + && useradd -l -M --shell /usr/sbin/nologin --uid {{ user.uid }} --gid {{ user.gid }} {{ name }} + {%- if not loop.last %} \{% endif -%} +{%- endfor %} + {% if base_distro == 'centos' %} RUN sed -ri '/-session(\s+)optional(\s+)pam_systemd.so/d' /etc/pam.d/system-auth \ && sed -ri '/^[^#]/ s/systemd//g' /etc/nsswitch.conf |
