lib/beaker/hypervisor/docker.rb in beaker-1.17.7 vs lib/beaker/hypervisor/docker.rb in beaker-1.18.0
- old
+ new
@@ -62,10 +62,11 @@
@hosts.each do |host|
if container = host['docker_container']
@logger.debug("stop container #{container.id}")
begin
container.stop
+ sleep 2 # avoid a race condition where the root FS can't unmount
rescue Excon::Errors::ClientError => e
@logger.warn("stop of container #{container.id} failed: #{e.response.body}")
end
@logger.debug("delete container #{container.id}")
begin
@@ -110,22 +111,22 @@
# add platform-specific actions
case host['platform']
when /ubuntu/, /debian/
dockerfile += <<-EOF
RUN apt-get update
- RUN apt-get install -y openssh-server openssh-client
+ RUN apt-get install -y openssh-server openssh-client #{Beaker::HostPrebuiltSteps::DEBIAN_PACKAGES.join(' ')}
EOF
when /^el-/, /centos/, /fedora/, /redhat/
dockerfile += <<-EOF
RUN yum clean all
- RUN yum install -y sudo openssh-server openssh-clients
+ RUN yum install -y sudo openssh-server openssh-clients #{Beaker::HostPrebuiltSteps::UNIX_PACKAGES.join(' ')}
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
EOF
when /opensuse/, /sles/
sshd_options = '-o "PermitRootLogin yes" -o "PasswordAuthentication yes" -o "UsePAM no"'
dockerfile += <<-EOF
- RUN zypper -n in openssh
+ RUN zypper -n in openssh #{Beaker::HostPrebuiltSteps::SLES_PACKAGES.join(' ')}
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
EOF
else
# TODO add more platform steps here