在构建Docker容器时,Packer shell配置会挂起

时间:2014-11-17 18:23:32

标签: docker boot2docker packer

我正在尝试构建和配置docker容器,但是当我运行它时,它会在运行配置脚本时挂起。

我使用以下方式在OSX上运行:

Boot2Docker-cli version: v1.3.1
Packer v0.7.2

**docker version**
Client version: 1.3.1
Client API version: 1.15
Server version: 1.3.1
Server API version: 1.15

运行此:

packer build ./packer-build-templates/docker/testsite/testsite.json

封隔器构建的模板/搬运工/测试网站/ testsite.json

 {
          "builders": [
            {
              "type": "docker",
              "image": "centos:centos6",
              "commit": "true"
            }
          ],
          "provisioners": [

                        {
                          "type": "shell",
                          "script": "script.sh"
                        }
                ],


        "post-processors": [
                [
                    {
                        "type": "docker-tag",
                        "repository": "test/stuff",
                        "tag": "latest"
                    }
                ]
            ]



        }

script.sh

#!/bin/sh -x
echo foo

输出:

==> docker: Creating a temporary directory for sharing data...
==> docker: Pulling Docker image: centos:centos6
    docker: centos:centos6: The image you are pulling has been verified
    docker: Status: Image is up to date for centos:centos6
==> docker: Starting docker container...
    docker: Run command: docker run -v /var/folders/z2/nm_4_yyx2ss9z8wn4h0bfd1jw_pj8j/T/packer-docker208208953:/packer-files -d -i -t centos:centos6 /bin/bash
    docker: Container ID: 3ab21c7c21bc4af84e0f0c7bdbac91ee600d1ea0a469bfa51a959faba73fa7e4
==> docker: Provisioning with shell script: script.sh

这就是它。然后就坐在那里。知道这里发生了什么吗?

0 个答案:

没有答案