Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/stacker/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ func (b *Builder) build(s types.Storage, file string) error {
log.Infof("failed executing %s: %s\n", opts.OnRunFailure, err2)
}
}
return errors.Errorf("run commands failed: %s", err)
return errors.Errorf("run commands failed for image %q in %q: %s", name, sf.FilePath(), err)
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/stacker/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (c *Converter) convertCommand(cmd *Command) error {
c.env[key] = val
}
case "workdir":
layer.Run = append(layer.Run, fmt.Sprintf("mkdir -p %s", cmd.Value[0]))
layer.Run = append(layer.Run, fmt.Sprintf("cd %s", cmd.Value[0]))
c.currDir = cmd.Value[0]
case "arg":
Expand Down
4 changes: 4 additions & 0 deletions pkg/types/stackerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (sf *Stackerfile) Get(name string) (Layer, bool) {
return layer, ok
}

func (sf *Stackerfile) FilePath() string {
return sf.path
}

func (sf *Stackerfile) Len() int {
return len(sf.internal)
}
Expand Down
2 changes: 1 addition & 1 deletion test/convert.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EOF

@test "elasticsearch" {
skip_slow_test
git clone https://github.com/elastic/dockerfiles.git
git clone -b v9.2.4 https://github.com/elastic/dockerfiles.git
chmod -R a+rwx dockerfiles
cd dockerfiles/elasticsearch
stacker convert --docker-file Dockerfile --output-file stacker.yaml --substitute-file stacker-subs.yaml
Expand Down
Loading