Skip to content

Commit

Permalink
Install docker using docker repo instead of convenience script
Browse files Browse the repository at this point in the history
This approach will be more stable than depending on a convenience
script provided by docker

ref: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script
  • Loading branch information
soapy1 committed Apr 1, 2020
1 parent f7d6070 commit d87d421
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/provisioners/docker/cap/redhat/docker_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions templates/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down

0 comments on commit d87d421

Please sign in to comment.