itamae icon indicating copy to clipboard operation
itamae copied to clipboard

Added backend docker configs

Open tk-hamaguchi opened this issue 9 years ago • 3 comments

  • Added tty: true to execute commands with docker.
  • Modified log format with docker results.
require 'docker'
require 'itamae'

@backend = Itamae::Backend.create(:docker, image: 'centos:7')
# => TypeError: no implicit conversion of Array into String
# Because Docker.logger.debug call with Array in  Docker::Connection#log_request.
# And set Itamae.logger to ::Docker.logger at Itamae::Backend::Docker#create_specinfra_backend.

@backend.run_command('yum install -y sudo')
@backend.run_command('sudo -H -u root -- /bin/sh -c cd /tmp/ && ls -l')
# => sudo: sorry, you must have a tty to run sudo
# Because Specinfra::Backend::Docker#run_command was not call with { tty: true}.

tk-hamaguchi avatar Oct 03 '15 15:10 tk-hamaguchi

I apologize for my poor English.

tk-hamaguchi avatar Oct 03 '15 15:10 tk-hamaguchi

@tk-hamaguchi Sorry for very late reply... Would you rebase the branch?

ryotarai avatar Mar 15 '16 00:03 ryotarai

+1

umisora avatar Nov 15 '16 00:11 umisora