Permalink
Browse files

use docker 'exec' instead of 'attach' for remote execution

  • Loading branch information...
mariussturm committed Dec 19, 2014
1 parent 9711bec commit 3a286ab6bdba7b8e5bf6a43c357a0ffeacd3dc97
Showing with 1 addition and 1 deletion.
  1. +1 −1 builder/docker/communicator.go
@@ -41,7 +41,7 @@ func (c *Communicator) Start(remote *packer.RemoteCmd) error {
// This file will store the exit code of the command once it is complete.
exitCodePath := outputFile.Name() + "-exit"
- cmd := exec.Command("docker", "attach", c.ContainerId)
+ cmd := exec.Command("docker", "exec", "-i", c.ContainerId, "/bin/sh")
stdin_w, err := cmd.StdinPipe()
if err != nil {
// We have to do some cleanup since run was never called

9 comments on commit 3a286ab

@dfinninger

This comment has been minimized.

Show comment
Hide comment
@dfinninger

dfinninger Jan 9, 2015

👍 Have you thought about making a pull request to mitchellh/packer?

👍 Have you thought about making a pull request to mitchellh/packer?

@mariussturm

This comment has been minimized.

Show comment
Hide comment
@mariussturm

mariussturm Jan 10, 2015

Owner

Done! :)

Owner

mariussturm replied Jan 10, 2015

Done! :)

@dfinninger

This comment has been minimized.

Show comment
Hide comment

Cool!

@richardfriedman

This comment has been minimized.

Show comment
Hide comment
@hd-deman

This comment has been minimized.

Show comment
Hide comment

+1

@peterloron

This comment has been minimized.

Show comment
Hide comment

+1

@moshe

This comment has been minimized.

Show comment
Hide comment

moshe replied Feb 7, 2015

+1

@chiefy

This comment has been minimized.

Show comment
Hide comment
@chiefy

chiefy Feb 25, 2015

👍 please merge this

👍 please merge this

@romankor

This comment has been minimized.

Show comment
Hide comment
@romankor

romankor Sep 22, 2015

Merge that please !!!!!

Merge that please !!!!!

Please sign in to comment.