Ask Your Question

Beaker not able to SSH into Docker CentOS container while I can manually

asked 2016-07-05 02:23:16 -0600

anandis gravatar image

Hi everyone,

Basically I'm trying to run some silly acceptance tests on Docker containers before I get my hands dirty with them (my only acceptance test as of now only contains a notify).

Using the official Ubuntu images everything is fine, I can see the output of notify . However when I try the CentOS images Beaker is not able to configure the box using SSH.

My default.yml looks like the following (it's a very simple one):

    platform: centos-7-x64
    image: centos:7
    hypervisor: docker
    type: foss
    log_level: verbose

When executing bundle exec rake acceptance, I can see the following at the beginning:

Dockerfile is FROM centos:7                                                                               
RUN yum clean all                                                                                       
RUN yum install -y sudo openssh-server openssh-clients curl ntpdate                                     
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key                                                      
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key                                                      
RUN mkdir -p /var/run/sshd                                                                                
RUN echo root:root | chpasswd                                                                             
RUN sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config                           
RUN sed -ri 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config             
EXPOSE 22                                                                                                 
CMD ["sh", "-c", "service sshd start ; tail -f /dev/null"]

Which to me it seems that this is changing the root password to root. However some lines below I get all these timeouts, hence I won't be able to run any integration tests on CentOS 7 boxes.

  Attempting ssh connection to, user: root, opts: {:password=>"root", :port=>"32769", :forward_agent=>false, :user=>"root"}
  Warning: Try 7 -- Host unreachable: Net::SSH::Disconnect - connection closed by remote host
  Warning: Trying again in 55 seconds

If it's worth something, I executed bash manually on the container and verified that the root password is indeed root, so I don't really know what could be happening.

Did anyone experience anything similar?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-09-16 14:11:34 -0600

I had the same issue running it with my Centos 7 image, when i destroyed it and downloaded one from it worked without any issues.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-07-05 02:23:16 -0600

Seen: 713 times

Last updated: Sep 16 '16