diff --git a/doc/source/admin/image-building.rst b/doc/source/admin/image-building.rst index 41e556e395..2f53588aa6 100644 --- a/doc/source/admin/image-building.rst +++ b/doc/source/admin/image-building.rst @@ -164,7 +164,7 @@ Build OpenStack from source When building images, there are two methods of the OpenStack install. One is ``binary``. Another is ``source``. The ``binary`` means that OpenStack will be -installed from apt/yum. And the ``source`` means that OpenStack will be +installed from apt/dnf. And the ``source`` means that OpenStack will be installed from source code. The default method of the OpenStack install is ``binary``. It can be changed to ``source`` using the ``-t`` option: diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index a0a0ffebec..07dcc9461e 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -51,10 +51,12 @@ RUN CURRENT_DISTRO_RELEASE=$(awk '{match($0, /[0-9]+/,version)}END{print version && cat /tmp/kolla_bashrc >> /etc/bashrc \ && sed -i 's|^\(override_install_langs=.*\)|# \1|' /etc/dnf/dnf.conf +{% block base_dnf_conf %} {% block base_yum_conf %} COPY dnf.conf /etc/dnf/dnf.conf +{% endblock %} {% endblock %} # Install what is needed for en_US.UTF-8 diff --git a/docker/bifrost/bifrost-base/Dockerfile.j2 b/docker/bifrost/bifrost-base/Dockerfile.j2 index 9efeef674b..72521cbe28 100644 --- a/docker/bifrost/bifrost-base/Dockerfile.j2 +++ b/docker/bifrost/bifrost-base/Dockerfile.j2 @@ -34,7 +34,7 @@ WORKDIR /bifrost {% if base_package_type == 'rpm' %} {# Remove updated RabbitMQ packages since these are not supported by Bifrost yet. #} RUN rm -f /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo \ - && yum clean all && rm -rf /var/yum/cache + && dnf clean all && rm -rf /var/dnf/cache {% elif base_package_type == 'deb' %} RUN sed -e "s/.*mariadb.*//Ig" -e "s/.*rabbitmq.*//Ig" -i /etc/apt/sources.list \ && apt-get purge -y mariadb* mysql* @@ -55,7 +55,7 @@ RUN echo " " && \ {%- if base_package_type == 'deb' %} apt-get clean && rm -rf /var/lib/apt/lists/*' {%- else %} - yum clean all && rm -rf /var/yum/cache' + dnf clean all && rm -rf /var/dnf/cache' {%- endif %} {% endblock %} {% endif %} diff --git a/docker/cyborg/cyborg-agent/Dockerfile.j2 b/docker/cyborg/cyborg-agent/Dockerfile.j2 index 97e3790dd8..c50c5fc9fd 100644 --- a/docker/cyborg/cyborg-agent/Dockerfile.j2 +++ b/docker/cyborg/cyborg-agent/Dockerfile.j2 @@ -39,7 +39,7 @@ RUN curl -sSL -o /tmp/opae-libs.rpm ${opae_libs_rpm_url} \ && echo "${opae_libs_rpm_sha1sum} /tmp/opae-libs.rpm" | sha1sum -c \ && curl -sSL -o /tmp/opae-devel.rpm ${opae_devel_rpm_url} \ && echo "${opae_devel_rpm_sha1sum} /tmp/opae-devel.rpm" | sha1sum -c \ - && yum -y install /tmp/opae-libs.rpm /tmp/opae-devel.rpm \ + && dnf -y install /tmp/opae-libs.rpm /tmp/opae-devel.rpm \ && rm -f /tmp/opae-libs.rpm /tmp/opae-devel.rpm # NOTE(Bai Yongjun) Required packages are only supported Ubuntu16.04 diff --git a/docker/logstash/Dockerfile.j2 b/docker/logstash/Dockerfile.j2 index 66a77296be..3e8bcdb1f4 100644 --- a/docker/logstash/Dockerfile.j2 +++ b/docker/logstash/Dockerfile.j2 @@ -47,7 +47,7 @@ ENV logstash_rpm_url=https://download.elastic.co/logstash/logstash/packages/cent ENV logstash_rpm_sha1sum=68c5e78c3d941f06f77d638c0756b6aea715bec5 RUN curl -sSL -o /tmp/logstash.rpm ${logstash_rpm_url} \ && echo "${logstash_rpm_sha1sum} /tmp/logstash.rpm" | sha1sum -c \ - && yum -y install /tmp/logstash.rpm \ + && dnf -y install /tmp/logstash.rpm \ && rm -f /tmp/logstash.rpm {% elif base_package_type == 'deb' %} diff --git a/kolla/image/build.py b/kolla/image/build.py index 7f5c833e43..dec484af6f 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -833,8 +833,8 @@ class KollaWorker(object): for config in rpm_setup_config: if config.endswith('.rpm'): - # RPM files can be installed with yum from file path or url - cmd = "RUN yum -y install {}".format(config) + # RPM files can be installed with dnf from file path or url + cmd = "RUN dnf -y install {}".format(config) elif config.endswith('.repo'): if config.startswith('http'): # Curl http://url/etc.repo to /etc/yum.repos.d/etc.repo diff --git a/tools/validate-install-command.sh b/tools/validate-install-command.sh index bc74096902..eff67d5cfe 100755 --- a/tools/validate-install-command.sh +++ b/tools/validate-install-command.sh @@ -3,8 +3,8 @@ RES=0 for dockerfile in "$@"; do - if grep "apt-get install\|yum install" "$dockerfile"; then - echo "ERROR: $dockerfile has incorrectly formatted install command Should be in the form 'apt-get|yum -y install ...'" >&2 + if grep "apt-get install\|dnf install" "$dockerfile"; then + echo "ERROR: $dockerfile has incorrectly formatted install command Should be in the form 'apt-get|dnf -y install ...'" >&2 RES=1 fi done