Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
4a98ab37
Commit
4a98ab37
authored
Jul 21, 2014
by
Andy Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Stderr capture to Commit and TagImage calls.
parent
ed446782
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
builder/docker/driver_docker.go
builder/docker/driver_docker.go
+9
-2
No files found.
builder/docker/driver_docker.go
View file @
4a98ab37
...
...
@@ -37,15 +37,19 @@ func (d *DockerDriver) DeleteImage(id string) error {
func
(
d
*
DockerDriver
)
Commit
(
id
string
)
(
string
,
error
)
{
var
stdout
bytes
.
Buffer
var
stderr
bytes
.
Buffer
cmd
:=
exec
.
Command
(
"docker"
,
"commit"
,
id
)
cmd
.
Stdout
=
&
stdout
cmd
.
Stderr
=
&
stderr
if
err
:=
cmd
.
Start
();
err
!=
nil
{
return
""
,
err
}
if
err
:=
cmd
.
Wait
();
err
!=
nil
{
err
=
fmt
.
Errorf
(
"Error committing container: %s"
,
err
)
err
=
fmt
.
Errorf
(
"Error committing container: %s
\n
Stderr: %s"
,
err
,
stderr
.
String
())
return
""
,
err
}
...
...
@@ -190,14 +194,17 @@ func (d *DockerDriver) StopContainer(id string) error {
}
func
(
d
*
DockerDriver
)
TagImage
(
id
string
,
repo
string
)
error
{
var
stderr
bytes
.
Buffer
cmd
:=
exec
.
Command
(
"docker"
,
"tag"
,
id
,
repo
)
cmd
.
Stderr
=
&
stderr
if
err
:=
cmd
.
Start
();
err
!=
nil
{
return
err
}
if
err
:=
cmd
.
Wait
();
err
!=
nil
{
err
=
fmt
.
Errorf
(
"Error tagging image: %s"
,
err
)
err
=
fmt
.
Errorf
(
"Error tagging image: %s
\n
Stderr: %s"
,
err
,
stderr
.
String
())
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment