【问题标题】:How to get image from a docker repo for test kitchen如何从 docker repo 获取图像以进行测试厨房
【发布时间】:2019-04-29 23:00:36
【问题描述】:

我需要使用 Docker Image httpd 测试我的应用程序,当我将其添加到当前的 .kitchen.yaml 文件时,它失败并出现错误:


root@ip-172-31-1-22:~/test1# kitchen test
-----> Starting Kitchen (v1.23.2)
-----> Cleaning up any prior instances of <default-httpd>
-----> Destroying <default-httpd>...
       Finished destroying <default-httpd> (0m0.00s).
-----> Testing <default-httpd>
-----> Creating <default-httpd>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Create failed on instance <default-httpd>.  Please see       .kitchen/logs/default-httpd.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

root@ip-172-31-1-22:~/test1#


我的 Kitchen.yaml 文件

driver:
  name: docker
  use_sudo: false
  #image: httpd

provisioner:
  hosts: aws
  name: ansible_playbook
  #roles_path: roles
  require_ansible_repo: true
  ansible_verbose: true
  ansible_version: latest
  require_chef_for_busser: false
  playbook: default.yml

verifier:
 name: inspec

platforms:
  #- name: ubuntu
  - name: httpd
    driver_config:
      run_command: /bin/systemd
      privileged: true
provision_command:
        - systemctl enable sshd.service

suites:
  - name: default
    verifier:
      inspec_tests:
        - path: /root/kitchen/test/integration/default/test.rb

用例:

1> Deoloy a Httpd base container 
2> Use Ansible Play book to move a index.html file
3> Use ansible tos tart and stop the services 
4> Run an inspec to check if the tests are successful

使用 kitchen.yaml 部署 httpd 并测试用例的正确程序是什么。

1> Is this the correct Approch??
2> Should i simply write a Ansible playbook to install httpd and then move my html files.
3> If the Answer to Q2 is yes, then doesn't it defeat the purpose of having an httpd Container already

【问题讨论】:

    标签: docker chef-infra chef-recipe test-kitchen inspec


    【解决方案1】:

    既然你用的是ansible,那就用docker modules来部署httpd

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多