Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell scripts broken with Docker 1.4.x #1752

Closed
pleschev opened this issue Dec 12, 2014 · 85 comments · Fixed by #2807
Closed

Shell scripts broken with Docker 1.4.x #1752

pleschev opened this issue Dec 12, 2014 · 85 comments · Fixed by #2807
Assignees

Comments

@pleschev
Copy link

Using the current source version of packer

Working scenario using docker 1.3.3:

2014/12/12 15:49:51 packer-builder-docker: 2014/12/12 15:49:51 Running the provision hook
1418399391,,ui,message,    docker: Container ID: b0117b8cbffd154539242acb24666f703b78ff22ef782e0d03cc768ba38db982
2014/12/12 15:49:51 packer-provisioner-shell: 2014/12/12 15:49:51 Opening /tmp/packer-shell648686173 for reading
2014/12/12 15:49:51 packer-provisioner-shell: 2014/12/12 15:49:51 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:49:51 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:49:51 packer-builder-docker: 2014/12/12 15:49:51 Executing in container b0117b8cbffd154539242acb24666f703b78ff22ef782e0d03cc768ba38db982: "(cp /packer-files/upload080199707 /tmp/script.sh) >/packer-files/cmd466238654 2>&1; echo $? >/packer-files/cmd466238654-exit"
1418399391,,ui,say,==> docker: Provisioning with shell script: /tmp/packer-shell648686173
2014/12/12 15:49:53 packer-builder-docker: 2014/12/12 15:49:53 Waiting for exit code to appear for remote command...
2014/12/12 15:49:53 packer-builder-docker: 2014/12/12 15:49:53 Executed command exit status: 0
2014/12/12 15:49:55 packer-builder-docker: 2014/12/12 15:49:55 Executing in container b0117b8cbffd154539242acb24666f703b78ff22ef782e0d03cc768ba38db982: "(chmod 0777 /tmp/script.sh) >/packer-files/cmd678804741 2>&1; echo $? >/packer-files/cmd678804741-exit"
2014/12/12 15:49:57 packer-builder-docker: 2014/12/12 15:49:57 Waiting for exit code to appear for remote command...
2014/12/12 15:49:57 packer-builder-docker: 2014/12/12 15:49:57 Executed command exit status: 0
2014/12/12 15:49:59 packer-builder-docker: 2014/12/12 15:49:59 [INFO] RPC endpoint: Communicator ended with: 0
2014/12/12 15:49:59 [INFO] RPC client: Communicator ended with: 0
2014/12/12 15:49:59 [INFO] RPC endpoint: Communicator ended with: 0
2014/12/12 15:49:59 packer-provisioner-shell: 2014/12/12 15:49:59 [INFO] RPC client: Communicator ended with: 0
2014/12/12 15:49:59 packer-builder-docker: 2014/12/12 15:49:59 Executing in container b0117b8cbffd154539242acb24666f703b78ff22ef782e0d03cc768ba38db982: "(chmod +x /tmp/script.sh; PACKER_BUILD_NAME='docker' PACKER_BUILDER_TYPE='docker' /tmp/script.sh) >/packer-files/cmd838923936 2>&1; echo $? >/packer-files/cmd838923936-exit"
2014/12/12 15:50:01 packer-builder-docker: 2014/12/12 15:50:01 Waiting for exit code to appear for remote command...
2014/12/12 15:50:02 packer-builder-docker: 2014/12/12 15:50:02 Executed command exit status: 127
2014/12/12 15:50:03 packer-builder-docker: 2014/12/12 15:50:03 [INFO] RPC endpoint: Communicator ended with: 127
2014/12/12 15:50:03 [INFO] 0 bytes written for 'stderr'
2014/12/12 15:50:03 [INFO] RPC client: Communicator ended with: 127
2014/12/12 15:50:03 [INFO] 0 bytes written for 'stdout'
2014/12/12 15:50:03 [INFO] RPC endpoint: Communicator ended with: 127
2014/12/12 15:50:03 packer-provisioner-shell: 2014/12/12 15:50:03 [INFO] 0 bytes written for 'stderr'
2014/12/12 15:50:03 packer-provisioner-shell: 2014/12/12 15:50:03 [INFO] RPC client: Communicator ended with: 127
2014/12/12 15:50:03 packer-provisioner-shell: 2014/12/12 15:50:03 [INFO] 0 bytes written for 'stdout'

Failing scenario using docker 1.4:

1418398765,,ui,say,==> docker: Provisioning with shell script: /tmp/packer-shell348099556
2014/12/12 15:39:25 packer-provisioner-shell: 2014/12/12 15:39:25 Opening /tmp/packer-shell348099556 for reading
2014/12/12 15:39:25 packer-provisioner-shell: 2014/12/12 15:39:25 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:25 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:25 packer-builder-docker: 2014/12/12 15:39:25 Executing in container ff13b288d87f7fa9d3c1e5ffeb810cc8fec6be80b1bd8eab21cc39a8e2b22336: "(cp /packer-files/upload431013147 /tmp/script.sh) >/packer-files/cmd669791166 2>&1; echo $? >/packer-files/cmd669791166-exit"
2014/12/12 15:39:27 packer-provisioner-shell: 2014/12/12 15:39:27 Retryable error: Error uploading script: Upload failed with non-zero exit status: 1
2014/12/12 15:39:29 packer-provisioner-shell: 2014/12/12 15:39:29 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:29 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:29 packer-builder-docker: 2014/12/12 15:39:29 Executing in container ff13b288d87f7fa9d3c1e5ffeb810cc8fec6be80b1bd8eab21cc39a8e2b22336: "(cp /packer-files/upload047296517 /tmp/script.sh) >/packer-files/cmd706862496 2>&1; echo $? >/packer-files/cmd706862496-exit"
2014/12/12 15:39:31 packer-provisioner-shell: 2014/12/12 15:39:31 Retryable error: Error uploading script: Upload failed with non-zero exit status: 1
2014/12/12 15:39:33 packer-provisioner-shell: 2014/12/12 15:39:33 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:33 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:33 packer-builder-docker: 2014/12/12 15:39:33 Executing in container ff13b288d87f7fa9d3c1e5ffeb810cc8fec6be80b1bd8eab21cc39a8e2b22336: "(cp /packer-files/upload033689215 /tmp/script.sh) >/packer-files/cmd209553362 2>&1; echo $? >/packer-files/cmd209553362-exit"
2014/12/12 15:39:35 packer-provisioner-shell: 2014/12/12 15:39:35 Retryable error: Error uploading script: Upload failed with non-zero exit status: 1
2014/12/12 15:39:37 packer-provisioner-shell: 2014/12/12 15:39:37 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:37 [INFO] 109 bytes written for 'uploadData'
2014/12/12 15:39:37 packer-builder-docker: 2014/12/12 15:39:37 Executing in container ff13b288d87f7fa9d3c1e5ffeb810cc8fec6be80b1bd8eab21cc39a8e2b22336: "(cp /packer-files/upload479277833 /tmp/script.sh) >/packer-files/cmd622516948 2>&1; echo $? >/packer-files/cmd622516948-exit"
2014/12/12 15:39:39 packer-provisioner-shell: 2014/12/12 15:39:39 Retryable error: Error uploading script: Upload failed with non-zero exit status: 1
2014/12/12 15:39:41 packer-provisioner-shell: 2014/12/12 15:39:41 [INFO] 109 bytes written for 'uploadData'
@diranged
Copy link

Just a followup.. when this was failing, it was using docker 1.4.0 from the latest docker repos. I just got it to work with this modified Vagrantfile:

Vagrant.configure("2") do |config|
  #config.vm.box = "phusion-open-ubuntu-14.04-amd64"
  #config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box"
  config.vm.box = "ubuntu"

  config.vm.provider :virtualbox do |vb|
    vb.name = 'packer-builder'
    vb.customize ["modifyvm", :id, "--memory", "2048" ]
    vb.customize ["modifyvm", :id, "--cpus",  "2" ]
    vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  end

  if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
    pkg_cmd = ""
    #pkg_cmd << "wget -q -O - https://get.docker.io/gpg | apt-key add -; "
    #pkg_cmd << "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list;"
    pkg_cmd << "apt-get update -qq; apt-get install -q -y --force-yes docker.io bsdtar; "
    pkg_cmd << "usermod -a -G docker vagrant; "
    pkg_cmd << "cd /usr/bin; wget -qO- https://dl.bintray.com/mitchellh/packer/packer_0.7.5_linux_amd64.zip | bsdtar -pxvf-; "
    pkg_cmd << "sudo chmod +x /usr/bin/packer*; "
    config.vm.provision :shell, :inline => pkg_cmd
  end
end

This installs Docker 1.0.1 ... and it works perfectly with the same Packer files.

@diranged
Copy link

Working Docker Version:

Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a

Non-Working:

Client version: 1.4.0
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 4595d4f
OS/Arch (client): linux/amd64
Server version: 1.4.0
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 4595d4f

@diranged
Copy link

Ok final update for the night ... it looks like Docker 1.4.0 is the issue. Docker 1.3.3 works fine:

Client version: 1.3.3
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): d344625
OS/Arch (client): linux/amd64
Server version: 1.3.3
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): d344625

@pleschev
Copy link
Author

it looks like Docker 1.4.0 is the issue. Docker 1.3.3 works fine:

Yup, that's the conclusion I came up with too

@pleschev
Copy link
Author

Confirmed that this is still a problem when using Docker 1.4.1

@pleschev pleschev changed the title Inline scripts broken with Docker 1.4 Inline scripts broken with Docker 1.4.x Dec 17, 2014
@pleschev
Copy link
Author

json file that recreates the problem:

{
  "builders": [
    {
      "type": "docker",
      "image": "ubuntu:latest",
      "pull": true,
      "export_path": "docker-burn.tar"
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "set -x",
        "set -e",
        "date"
      ]
    }
  ]
}

@ernoaapa
Copy link

👍 same here!

@mariussturm
Copy link

A naive fix would look like this:

mariussturm@3a286ab

This breaks backwards compatibility with Docker 1.3- (what is ok imo)

@logankoester
Copy link

@mariussturm Thanks for 3a286ab. There is a related problem with the chef-solo provisioner; the first command it runs (creating the staging_directory) kills the container, thus ending the build. Your solution resolves that as well.

@soupdiver
Copy link

I also can confirm this problem with Docker 1.4.1

@pythianliappis
Copy link

I am having the same issue (reported here when using inline) also when using the script element.
So essentially right now it is impossible to build docker v1.4.x images with packer with any of the shell provisioners.

The error is:

2014/12/25 12:21:30 packer-builder-docker: 2014/12/25 12:21:30 Executing in container 600d9cc40feaa99ee3f6b9ad6daf440dc79265abbbfa8676a45904463df1a353: "(cp /packer-files/upload674827840 /tmp/script.sh) >/packer-files/cmd940924575 2>&1; echo $? >/packer-files/cmd940924575-exit"
==> docker: Provisioning with shell script: /home/dl/testsourcedir/hello.sh
2014/12/25 12:21:32 packer-provisioner-shell: 2014/12/25 12:21:32 Retryable error: Error uploading script: Upload failed with non-zero exit status: 1

With a provisioner configuration like:

 "provisioners" : [
    {
        "type" : "shell",
        "script" : "{{pwd}}/testsourcedir/hello.sh"
    }
    ],

and a corresponding simple shell script:

[dl@localhost ~]$ cat testsourcedir/hello.sh
#!/bin/sh
echo "Hello"

@elliot42
Copy link

+1, with the script variant of the shell provisioner.

@pleschev pleschev changed the title Inline scripts broken with Docker 1.4.x Shell scripts broken with Docker 1.4.x Dec 30, 2014
@stefancocora
Copy link

+1
This provisioner has failed for me with the inline variant of the shell provisioner.

packer version
Packer v0.7.5
...
docker --version
Docker version 1.4.1, build 5bc2ff8

@iansmith
Copy link

Based on the comments above (and the commit by @mariussturm) I built a virtual box box that you can use with boot2docker and it has marius' change baked into packer provided. This required the source to packer and @mitchellh's Vagrantfile for packer (hacked to build a 32 bit binary) as well @YungSang's source code for how to build a vagrant box from boot2docker's iso. Open source to the rescue!

Hope this helps some folks who want to use docker 1.4.1 with packer inside a vagrant.

https://atlas.hashicorp.com/iansmith/boxes/boot2docker-plus-packer

@peterloron
Copy link

Urgh! Just ran into this one. Serious wrench in the gears for my project.

@vitorcoxta
Copy link

I also ran into this issue. What is the current workaround? Downgrade docker to 1.3.3?

@yanaga
Copy link

yanaga commented Feb 9, 2015

I had to downgrade docker to 1.3.3. That's my current workaround.

@pythianliappis
Copy link

@vitorcoxta and @yanaga Alternatively you can rebuilt a packer binary version of your own using the fix proposed by mariussturm:

3a286ab

@Lawouach
Copy link

With the new docker 1.5, it seems unfortunate we still have to use 1.3.3 due to this bug :/

@peterloron
Copy link

Any ETA on getting this rolled into a new release? 0.76, maybe?

@ksclarke
Copy link

👍

@chiefy
Copy link

chiefy commented Feb 14, 2015

Having this issue with:

Docker version 1.5.0, build a8a31ef
Packer v0.7.5
Boot2Docker-cli version: v1.5.0
Git commit: ccd9032

Darwin 13.4.0 Darwin Kernel Version 13.4.0: Wed Dec 17 19:05:52 PST 2014; root:xnu-2422.115.10~1/RELEASE_X86_64 x86_64

@stefancocora
Copy link

I've created a github repo , /~https://github.com/stefancocora/packer-issue1752-fix , that contains packer binaries (amd64) built against the master branch with mariussturm fix for this issue.
You can use the binaries I've built up to the point when the packer maintainers merge the fix for this issue and release a new version.
The binaries I've built work flawlesly for me, I've added a way to test them in the aformentioned github repo, see README.md

@ankon
Copy link
Contributor

ankon commented Feb 20, 2015

@stefancocora thanks a lot for the repository! I can confirm that that version works (on Fedora 21/x86_64, with docker 1.5.0).

One thing I noticed with the use of exec instead of attach: it would be nice to also use the -t flag, so that a tty is allocated, and tools like sudo work (CentOS by default has Defaults requiretty in /etc/sudoers).

@stefancocora
Copy link

Thanks for testing @ankon , good point about -t , didn't think about it.
I've just created a packer binary compiled for docker with the -t flag.
Unfortunately it fails to build an image and I don't know what is causing that failure.
Reverting packer to the patch without -t I get a successful docker image build.

Error output from packer build with -t

...
    docker: Status: Image is up to date for devopsil/puppet:latest
==> docker: Starting docker container...
    docker: Run command: docker run -v /tmp/packer-docker141026721:/packer-files -d -i -t devopsil/puppet /bin/bash
    docker: Container ID: 72e09e8c029a7321143cac4baf012525e1a816e35770a1cc216327005caf1912
==> docker: Uploading ./modules => /tmp/modules
==> docker: Killing the container: 72e09e8c029a7321143cac4baf012525e1a816e35770a1cc216327005caf1912
Build 'docker' errored: Upload failed with non-zero exit status: 1

==> Some builds didn't complete successfully and had errors:
--> docker: Upload failed with non-zero exit status: 1

==> Builds finished but no artifacts were created.

You can always disable requiretty in the sudoers file and that will allow sudo to work fine.

@thmttch
Copy link

thmttch commented May 29, 2015

Thanks! Been looking forward to this!

@xrow
Copy link

xrow commented Jun 3, 2015

@mitchellh When is the next release planned that includes this fix?

@aidanjl
Copy link

aidanjl commented Jun 3, 2015

@stefancocora Thanks for interim fix!

@lynchc
Copy link

lynchc commented Jun 3, 2015

awesome guys. Great work!

@stefancocora
Copy link

@aidanjl no problem , it is the least I could do to make @mariussturm fix easily accessible for anybody !

@sterburg
Copy link

sterburg commented Jun 9, 2015

@mitchellh please upgrade the packer that Atlas is using with this fix too, because currently i cannot build any docker images in Atlas. I need this to demo Atlas to my manager this thursday for we can buy Atlas.

@rvangundy
Copy link

I'm currently running Packer 0.8-dev and Docker 1.6.2 on OS X and still seeing this issue.

==> docker: Provisioning with shell script: /var/folders/7z/3_4h7g_x55b_stn8nyd2w4mc0000gn/T/packer-shell921079459
2015/06/19 15:13:00 packer-provisioner-shell: 2015/06/19 15:13:00 [INFO] 92 bytes written for 'uploadData'
2015/06/19 15:13:00 [INFO] 92 bytes written for 'uploadData'
2015/06/19 15:13:00 packer-builder-docker: 2015/06/19 15:13:00 Executing in container b77320622ccd70b787bf85e0d88680db0a8a29ea4946aad7d18ceb7dc181362c: "(command cp /packer-files/upload556204673 /tmp/script_7943.sh) >/packer-files/cmd576371692 2>&1; echo $? >/packer-files/cmd576371692-exit"
2015/06/19 15:13:02 packer-builder-docker: 2015/06/19 15:13:02 Waiting for exit code to appear for remote command...

I've also tried downgrading to Docker 1.3.3 and encountering the same thing.

@dfarrell07
Copy link

Packer v0.8.0 was tagged and released to the downloads page yesterday, which should actually fix this. It's working for me with Docker 1.5.0, after upgrading Packer 0.7.5 to 0.8.0.

@jacyzon
Copy link

jacyzon commented Jun 24, 2015

@stefancocora
Copy link

verified and working correctly with Packer v0.8.0 and docker Client version: 1.6.2 on an Ubuntu 14.04 x64 host.

@lukeowen89
Copy link

I'm still experiencing this issue on osx. Packer version 0.8.0, docker version 1.6.2 and 1.7.0. Will have a go on a linux distro to see if I have any more luck.

@claco
Copy link

claco commented Jul 2, 2015

Same as @lukeowen89
Kind of a drag I still can't packer on osx at this point.

@bobzoller
Copy link

Also broken for me on OSX. Packer 0.8.1, Docker 1.7.1

packer debug log

2015/07/15 23:42:08 [INFO] Packer version: 0.8.1  872e78d5b0a387eb3b87ddeef210264c3199d178+CHANGES
2015/07/15 23:42:08 Packer Target OS/Arch: darwin amd64
2015/07/15 23:42:08 Built with Go Version: go1.4.2
2015/07/15 23:42:08 [DEBUG] Discovered plugin: amazon-chroot = /usr/local/bin/packer-builder-amazon-chroot
2015/07/15 23:42:08 [DEBUG] Discovered plugin: amazon-ebs = /usr/local/bin/packer-builder-amazon-ebs
2015/07/15 23:42:08 [DEBUG] Discovered plugin: amazon-instance = /usr/local/bin/packer-builder-amazon-instance
2015/07/15 23:42:08 [DEBUG] Discovered plugin: digitalocean = /usr/local/bin/packer-builder-digitalocean
2015/07/15 23:42:08 [DEBUG] Discovered plugin: docker = /usr/local/bin/packer-builder-docker
2015/07/15 23:42:08 [DEBUG] Discovered plugin: file = /usr/local/bin/packer-builder-file
2015/07/15 23:42:08 [DEBUG] Discovered plugin: googlecompute = /usr/local/bin/packer-builder-googlecompute
2015/07/15 23:42:08 [DEBUG] Discovered plugin: null = /usr/local/bin/packer-builder-null
2015/07/15 23:42:08 [DEBUG] Discovered plugin: openstack = /usr/local/bin/packer-builder-openstack
2015/07/15 23:42:08 [DEBUG] Discovered plugin: parallels-iso = /usr/local/bin/packer-builder-parallels-iso
2015/07/15 23:42:08 [DEBUG] Discovered plugin: parallels-pvm = /usr/local/bin/packer-builder-parallels-pvm
2015/07/15 23:42:08 [DEBUG] Discovered plugin: qemu = /usr/local/bin/packer-builder-qemu
2015/07/15 23:42:08 [DEBUG] Discovered plugin: virtualbox-iso = /usr/local/bin/packer-builder-virtualbox-iso
2015/07/15 23:42:08 [DEBUG] Discovered plugin: virtualbox-ovf = /usr/local/bin/packer-builder-virtualbox-ovf
2015/07/15 23:42:08 [DEBUG] Discovered plugin: vmware-iso = /usr/local/bin/packer-builder-vmware-iso
2015/07/15 23:42:08 [DEBUG] Discovered plugin: vmware-vmx = /usr/local/bin/packer-builder-vmware-vmx
2015/07/15 23:42:08 [DEBUG] Discovered plugin: atlas = /usr/local/bin/packer-post-processor-atlas
2015/07/15 23:42:08 [DEBUG] Discovered plugin: compress = /usr/local/bin/packer-post-processor-compress
2015/07/15 23:42:08 [DEBUG] Discovered plugin: docker-import = /usr/local/bin/packer-post-processor-docker-import
2015/07/15 23:42:08 [DEBUG] Discovered plugin: docker-push = /usr/local/bin/packer-post-processor-docker-push
2015/07/15 23:42:08 [DEBUG] Discovered plugin: docker-save = /usr/local/bin/packer-post-processor-docker-save
2015/07/15 23:42:08 [DEBUG] Discovered plugin: docker-tag = /usr/local/bin/packer-post-processor-docker-tag
2015/07/15 23:42:08 [DEBUG] Discovered plugin: vagrant = /usr/local/bin/packer-post-processor-vagrant
2015/07/15 23:42:08 [DEBUG] Discovered plugin: vagrant-cloud = /usr/local/bin/packer-post-processor-vagrant-cloud
2015/07/15 23:42:08 [DEBUG] Discovered plugin: vsphere = /usr/local/bin/packer-post-processor-vsphere
2015/07/15 23:42:08 [DEBUG] Discovered plugin: ansible-local = /usr/local/bin/packer-provisioner-ansible-local
2015/07/15 23:42:08 [DEBUG] Discovered plugin: chef-client = /usr/local/bin/packer-provisioner-chef-client
2015/07/15 23:42:08 [DEBUG] Discovered plugin: chef-solo = /usr/local/bin/packer-provisioner-chef-solo
2015/07/15 23:42:08 [DEBUG] Discovered plugin: file = /usr/local/bin/packer-provisioner-file
2015/07/15 23:42:08 [DEBUG] Discovered plugin: powershell = /usr/local/bin/packer-provisioner-powershell
2015/07/15 23:42:08 [DEBUG] Discovered plugin: puppet-masterless = /usr/local/bin/packer-provisioner-puppet-masterless
2015/07/15 23:42:08 [DEBUG] Discovered plugin: puppet-server = /usr/local/bin/packer-provisioner-puppet-server
2015/07/15 23:42:08 [DEBUG] Discovered plugin: salt-masterless = /usr/local/bin/packer-provisioner-salt-masterless
2015/07/15 23:42:08 [DEBUG] Discovered plugin: shell = /usr/local/bin/packer-provisioner-shell
2015/07/15 23:42:08 [DEBUG] Discovered plugin: shell-local = /usr/local/bin/packer-provisioner-shell-local
2015/07/15 23:42:08 [DEBUG] Discovered plugin: windows-restart = /usr/local/bin/packer-provisioner-windows-restart
2015/07/15 23:42:08 [DEBUG] Discovered plugin: windows-shell = /usr/local/bin/packer-provisioner-windows-shell
2015/07/15 23:42:08 Detected home directory from env var: /Users/bob
2015/07/15 23:42:08 Detected home directory from env var: /Users/bob
2015/07/15 23:42:08 Attempting to open config file: /Users/bob/.packerconfig
2015/07/15 23:42:08 [WARN] Config file doesn't exist: /Users/bob/.packerconfig
2015/07/15 23:42:08 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[digitalocean:/usr/local/bin/packer-builder-digitalocean googlecompute:/usr/local/bin/packer-builder-googlecompute virtualbox-ovf:/usr/local/bin/packer-builder-virtualbox-ovf amazon-instance:/usr/local/bin/packer-builder-amazon-instance vmware-vmx:/usr/local/bin/packer-builder-vmware-vmx amazon-chroot:/usr/local/bin/packer-builder-amazon-chroot null:/usr/local/bin/packer-builder-null vmware-iso:/usr/local/bin/packer-builder-vmware-iso openstack:/usr/local/bin/packer-builder-openstack parallels-iso:/usr/local/bin/packer-builder-parallels-iso parallels-pvm:/usr/local/bin/packer-builder-parallels-pvm qemu:/usr/local/bin/packer-builder-qemu virtualbox-iso:/usr/local/bin/packer-builder-virtualbox-iso amazon-ebs:/usr/local/bin/packer-builder-amazon-ebs docker:/usr/local/bin/packer-builder-docker file:/usr/local/bin/packer-builder-file] PostProcessors:map[atlas:/usr/local/bin/packer-post-processor-atlas docker-tag:/usr/local/bin/packer-post-processor-docker-tag vagrant-cloud:/usr/local/bin/packer-post-processor-vagrant-cloud vsphere:/usr/local/bin/packer-post-processor-vsphere compress:/usr/local/bin/packer-post-processor-compress docker-import:/usr/local/bin/packer-post-processor-docker-import docker-push:/usr/local/bin/packer-post-processor-docker-push docker-save:/usr/local/bin/packer-post-processor-docker-save vagrant:/usr/local/bin/packer-post-processor-vagrant] Provisioners:map[shell-local:/usr/local/bin/packer-provisioner-shell-local windows-shell:/usr/local/bin/packer-provisioner-windows-shell ansible-local:/usr/local/bin/packer-provisioner-ansible-local chef-client:/usr/local/bin/packer-provisioner-chef-client file:/usr/local/bin/packer-provisioner-file salt-masterless:/usr/local/bin/packer-provisioner-salt-masterless shell:/usr/local/bin/packer-provisioner-shell chef-solo:/usr/local/bin/packer-provisioner-chef-solo powershell:/usr/local/bin/packer-provisioner-powershell puppet-masterless:/usr/local/bin/packer-provisioner-puppet-masterless puppet-server:/usr/local/bin/packer-provisioner-puppet-server windows-restart:/usr/local/bin/packer-provisioner-windows-restart]}
2015/07/15 23:42:08 Setting cache directory: /Users/bob/Projects/garbanzo/packer_cache
2015/07/15 23:42:08 Detected home directory from env var: /Users/bob
2015/07/15 23:42:08 Loading builder: docker
2015/07/15 23:42:08 Creating plugin client for path: /usr/local/bin/packer-builder-docker
2015/07/15 23:42:08 Starting plugin: /usr/local/bin/packer-builder-docker []string{"/usr/local/bin/packer-builder-docker"}
2015/07/15 23:42:08 Waiting for RPC address for: /usr/local/bin/packer-builder-docker
2015/07/15 23:42:08 packer-builder-docker: 2015/07/15 23:42:08 Plugin minimum port: 10000
2015/07/15 23:42:08 packer-builder-docker: 2015/07/15 23:42:08 Plugin maximum port: 25000
2015/07/15 23:42:08 packer-builder-docker: 2015/07/15 23:42:08 Plugin address: unix /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-plugin389384987
2015/07/15 23:42:08 packer-builder-docker: 2015/07/15 23:42:08 Waiting for connection...
2015/07/15 23:42:08 packer-builder-docker: 2015/07/15 23:42:08 Serving a plugin connection...
2015/07/15 23:42:08 Loading provisioner: shell
2015/07/15 23:42:08 Creating plugin client for path: /usr/local/bin/packer-provisioner-shell
2015/07/15 23:42:08 Starting plugin: /usr/local/bin/packer-provisioner-shell []string{"/usr/local/bin/packer-provisioner-shell"}
2015/07/15 23:42:08 Waiting for RPC address for: /usr/local/bin/packer-provisioner-shell
2015/07/15 23:42:08 packer-provisioner-shell: 2015/07/15 23:42:08 Plugin minimum port: 10000
2015/07/15 23:42:08 packer-provisioner-shell: 2015/07/15 23:42:08 Plugin maximum port: 25000
2015/07/15 23:42:08 packer-provisioner-shell: 2015/07/15 23:42:08 Plugin address: unix /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-plugin592962254
2015/07/15 23:42:08 packer-provisioner-shell: 2015/07/15 23:42:08 Waiting for connection...
2015/07/15 23:42:08 packer-provisioner-shell: 2015/07/15 23:42:08 Serving a plugin connection...
2015/07/15 23:42:08 Loading post-processor: docker-tag
2015/07/15 23:42:08 Creating plugin client for path: /usr/local/bin/packer-post-processor-docker-tag
2015/07/15 23:42:08 Starting plugin: /usr/local/bin/packer-post-processor-docker-tag []string{"/usr/local/bin/packer-post-processor-docker-tag"}
2015/07/15 23:42:08 Waiting for RPC address for: /usr/local/bin/packer-post-processor-docker-tag
2015/07/15 23:42:08 packer-post-processor-docker-tag: 2015/07/15 23:42:08 Plugin minimum port: 10000
2015/07/15 23:42:08 packer-post-processor-docker-tag: 2015/07/15 23:42:08 Plugin maximum port: 25000
2015/07/15 23:42:08 packer-post-processor-docker-tag: 2015/07/15 23:42:08 Plugin address: unix /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-plugin099680253
2015/07/15 23:42:08 packer-post-processor-docker-tag: 2015/07/15 23:42:08 Waiting for connection...
2015/07/15 23:42:08 packer-post-processor-docker-tag: 2015/07/15 23:42:08 Serving a plugin connection...
2015/07/15 23:42:08 ui: docker output will be in this color.
2015/07/15 23:42:08 ui: 
2015/07/15 23:42:08 Build debug mode: false
2015/07/15 23:42:08 Force build: false
2015/07/15 23:42:08 Preparing build: docker
docker output will be in this color.

2015/07/15 23:42:08 Waiting on builds to complete...
2015/07/15 23:42:08 Starting build run: docker
2015/07/15 23:42:08 Running builder: docker
2015/07/15 23:42:08 packer-builder-docker: 2015/07/15 23:42:08 [DEBUG] Docker version: 1.7.1
2015/07/15 23:42:08 ui: ==> docker: Creating a temporary directory for sharing data...
==> docker: Creating a temporary directory for sharing data...
2015/07/15 23:42:08 ui: ==> docker: Pulling Docker image: gliderlabs/herokuish
==> docker: Pulling Docker image: gliderlabs/herokuish
2015/07/15 23:42:08 packer-builder-docker: 2015/07/15 23:42:08 Executing: /usr/local/bin/docker [pull gliderlabs/herokuish]
2015/07/15 23:42:11 ui:     docker: latest: Pulling from gliderlabs/herokuish
    docker: latest: Pulling from gliderlabs/herokuish
2015/07/15 23:42:11 ui:     docker: 835c565d00e2: Already exists
    docker: 835c565d00e2: Already exists
2015/07/15 23:42:11 ui:     docker: c5c659229e15: Already exists
    docker: c5c659229e15: Already exists
2015/07/15 23:42:11 ui:     docker: 9a8403cd4d99: Already exists
    docker: 9a8403cd4d99: Already exists
2015/07/15 23:42:11 ui:     docker: 89fc314a0a6e: Already exists
    docker: 89fc314a0a6e: Already exists
2015/07/15 23:42:11 ui:     docker: d257698c42c5: Already exists
    docker: d257698c42c5: Already exists
2015/07/15 23:42:11 ui:     docker: c6c6baedb602: Already exists
    docker: c6c6baedb602: Already exists
2015/07/15 23:42:11 ui:     docker: c6c6baedb602: Already exists
    docker: c6c6baedb602: Already exists
2015/07/15 23:42:11 ui:     docker: Digest: sha256:4b08475f91eaccceb40fcbb5e0c43a992257b1bdedbf86f2777f458da9a0e2cd
2015/07/15 23:42:11 ui:     docker: Status: Image is up to date for gliderlabs/herokuish:latest
    docker: Digest: sha256:4b08475f91eaccceb40fcbb5e0c43a992257b1bdedbf86f2777f458da9a0e2cd
    docker: Status: Image is up to date for gliderlabs/herokuish:latest
2015/07/15 23:42:11 ui: ==> docker: Starting docker container...
==> docker: Starting docker container...
2015/07/15 23:42:11 ui:     docker: Run command: docker run -v /Users/bob/Projects/garbanzo:/tmp/app -v /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-docker638187454:/packer-files -d -i -t gliderlabs/herokuish /bin/bash
2015/07/15 23:42:11 packer-builder-docker: 2015/07/15 23:42:11 Starting container with args: [run -v /Users/bob/Projects/garbanzo:/tmp/app -v /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-docker638187454:/packer-files -d -i -t gliderlabs/herokuish /bin/bash]
    docker: Run command: docker run -v /Users/bob/Projects/garbanzo:/tmp/app -v /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-docker638187454:/packer-files -d -i -t gliderlabs/herokuish /bin/bash
2015/07/15 23:42:11 packer-builder-docker: 2015/07/15 23:42:11 Waiting for container to finish starting
2015/07/15 23:42:11 ui:     docker: Container ID: cc6a7056923234a1264718283c1a58a1c49796d64458cefe84e5ee4941c4bf16
    docker: Container ID: cc6a7056923234a1264718283c1a58a1c49796d64458cefe84e5ee4941c4bf16
2015/07/15 23:42:11 packer-builder-docker: 2015/07/15 23:42:11 Running the provision hook
2015/07/15 23:42:11 ui: ==> docker: Provisioning with shell script: /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-shell845253589
2015/07/15 23:42:11 packer-provisioner-shell: 2015/07/15 23:42:11 Opening /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-shell845253589 for reading
==> docker: Provisioning with shell script: /var/folders/4j/hd7wss1n4xzc8xn224xsyls80000gn/T/packer-shell845253589
2015/07/15 23:42:11 packer-provisioner-shell: 2015/07/15 23:42:11 [INFO] 44 bytes written for 'uploadData'
2015/07/15 23:42:11 [INFO] 44 bytes written for 'uploadData'
2015/07/15 23:42:11 packer-builder-docker: 2015/07/15 23:42:11 Executing in container cc6a7056923234a1264718283c1a58a1c49796d64458cefe84e5ee4941c4bf16: "(command cp /packer-files/upload803520517 /tmp/script_7943.sh) >/packer-files/cmd416685472 2>&1; echo $? >/packer-files/cmd416685472-exit"
2015/07/15 23:42:13 packer-builder-docker: 2015/07/15 23:42:13 Waiting for exit code to appear for remote command...
^C
2015/07/15 23:50:00 Closing stdin because interrupt received.
2015/07/15 23:50:00 Stopping build: docker
2015/07/15 23:50:00 packer-post-processor-docker-tag: 2015/07/15 23:50:00 Received interrupt signal (count: 1). Ignoring.
2015/07/15 23:50:00 packer-provisioner-shell: 2015/07/15 23:50:00 Received interrupt signal (count: 1). Ignoring.
2015/07/15 23:50:00 packer-builder-docker: 2015/07/15 23:50:00 Received interrupt signal (count: 1). Ignoring.
2015/07/15 23:50:00 packer-builder-docker: 2015/07/15 23:50:00 Cancelling the step runner...
2015/07/15 23:50:01 packer-builder-docker: 2015/07/15 23:50:01 Cancelling provisioning due to interrupt...
2015/07/15 23:50:01 Provisioner.Cancel err: unexpected EOF
2015/07/15 23:50:01 /usr/local/bin/packer-provisioner-shell: plugin process exited
2015/07/15 23:50:01 ui: ==> docker: Killing the container: cc6a7056923234a1264718283c1a58a1c49796d64458cefe84e5ee4941c4bf16
==> docker: Killing the container: cc6a7056923234a1264718283c1a58a1c49796d64458cefe84e5ee4941c4bf16
2015/07/15 23:50:01 Build cancelled: docker
2015/07/15 23:50:01 ui: Build 'docker' finished.
2015/07/15 23:50:01 Builds completed. Waiting on interrupt barrier...
2015/07/15 23:50:01 ui: Cleanly cancelled builds after being interrupted.
2015/07/15 23:50:01 waiting for all plugin processes to complete...
Build 'docker' finished.
Cleanly cancelled builds after being interrupted.
2015/07/15 23:50:01 /usr/local/bin/packer-post-processor-docker-tag: plugin process exited
2015/07/15 23:50:01 /usr/local/bin/packer-builder-docker: plugin process exited

poked around on the container before I killed it:

$ ls /packer-files
cmd416685472       cmd416685472-exit
$ cat /packer-files/cmd416685472
cp: cannot stat '/packer-files/upload803520517': No such file or directory

@Decipher
Copy link

Ditto, experiencing this issue on OSX with Packer 0.8.5 and Docker 1.8.1.

@cbednarski
Copy link
Contributor

@Decipher I opened a new issue for this here: #2675

@markpeek markpeek self-assigned this Oct 5, 2015
markpeek added a commit to markpeek/packer that referenced this issue Oct 6, 2015
When using docker-machine on a Mac only the /Users folder is shared with
the VM. Uploads fail since the normal tmpdir is not shared. This change
uses the local packer directory (usually when run in the users home
folders) allowing it to work without setting TMPDIR explicitly. A better
fix would be to use the docker API directly but that would force users
to use docker API version 20+.
This fixes hashicorp#901, fixes hashicorp#1752, fixes hashicorp#2436, fixes hashicorp#2675, fixes hashicorp#2697.
markpeek added a commit to markpeek/packer that referenced this issue Oct 7, 2015
When using docker-machine on a Mac only the /Users folder is shared with
the VM. Uploads fail since the normal tmpdir is not shared. This change
uses the local packer directory (usually when run in the users home
folders) allowing it to work without setting TMPDIR explicitly. A better
fix would be to use the docker API directly but that would force users
to use docker API version 20+.
- fixes hashicorp#901, fixes hashicorp#1752, fixes hashicorp#2436, fixes hashicorp#2675, fixes hashicorp#2697.
markpeek added a commit to markpeek/packer that referenced this issue Oct 7, 2015
When using docker-machine on a Mac only the /Users folder is shared with
the VM. Uploads fail since the normal tmpdir is not shared. This change
uses the local packer directory (usually when run in the users home
folders) allowing it to work without setting TMPDIR explicitly. A better
fix would be to use the docker API directly but that would force users
to use docker API version 20+.
- fixes hashicorp#901, fixes hashicorp#1752, fixes hashicorp#2436, fixes hashicorp#2675, fixes hashicorp#2697.
lolindrath pushed a commit to lolindrath/packer that referenced this issue Oct 14, 2015
When using docker-machine on a Mac only the /Users folder is shared with
the VM. Uploads fail since the normal tmpdir is not shared. This change
uses the local packer directory (usually when run in the users home
folders) allowing it to work without setting TMPDIR explicitly. A better
fix would be to use the docker API directly but that would force users
to use docker API version 20+.
- fixes hashicorp#901, fixes hashicorp#1752, fixes hashicorp#2436, fixes hashicorp#2675, fixes hashicorp#2697.
@dysinger
Copy link
Contributor

This is still a problem on Docker 1.12.1 with packer 0.10.2

@anthonyvallee
Copy link

I confirm having the same issue using Docker 1.12.1 and Packer 0.11.0.

@evanstachowiak
Copy link

This for me is only happening when packer is running inside of docker and then trying to provision a new docker. Maybe this is doing it wrong?

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet