diff --git a/plugins/provisioners/docker/cap/redhat/docker_install.rb b/plugins/provisioners/docker/cap/redhat/docker_install.rb index 76555749b80..027864304e3 100644 --- a/plugins/provisioners/docker/cap/redhat/docker_install.rb +++ b/plugins/provisioners/docker/cap/redhat/docker_install.rb @@ -4,15 +4,19 @@ module Cap module Redhat module DockerInstall def self.docker_install(machine) + machine.ui.warn(I18n.t("vagrant.provisioners.docker.rhel_not_supported")) + if machine.guest.capability("flavor") == :rhel_8 - machine.ui.warn("Docker is not supported on RHEL 8 machines.") raise DockerError, :install_failed end - + machine.communicate.tap do |comm| comm.sudo("yum -q -y update") comm.sudo("yum -q -y remove docker-io* || true") - comm.sudo("curl -fsSL https://get.docker.com/ | sh") + comm.sudo("yum install -y -q yum-utils") + comm.sudo("yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo") + comm.sudo("yum makecache") + comm.sudo("yum install -y -q docker-ce") end case machine.guest.capability("flavor") diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 743be476141..a9481fd1262 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -2821,6 +2821,9 @@ en: provisioner not_running: "Docker is not running on the guest VM." install_failed: "Docker installation failed." + rhel_not_supported: |- + RHEL is now only supported by Docker EE. Please install Docker EE or + switch to the Podman provisioner to run containers on RHEL. salt: minion_config_nonexist: |-