itamae
itamae copied to clipboard
Added backend docker configs
- 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}.
I apologize for my poor English.
@tk-hamaguchi Sorry for very late reply... Would you rebase the branch?
+1