Skip to content

Commit c45cd57

Browse files
authored
Merge pull request moby#5738 from crazy-max/dockerfile-device-error-nolabs
dockerfile: error out if device feature not used in labs
2 parents 388ec24 + 7fd5f5c commit c45cd57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/dockerfile/dockerfile2llb/convert_norundevice.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ package dockerfile2llb
55
import (
66
"github.com/moby/buildkit/client/llb"
77
"github.com/moby/buildkit/frontend/dockerfile/instructions"
8+
"github.com/pkg/errors"
89
)
910

10-
func dispatchRunDevices(_ *instructions.RunCommand) ([]llb.RunOption, error) {
11+
func dispatchRunDevices(c *instructions.RunCommand) ([]llb.RunOption, error) {
12+
if len(instructions.GetDevices(c)) > 0 {
13+
return nil, errors.Errorf("device feature is only supported in Dockerfile frontend 1.14.0-labs or later")
14+
}
1115
return nil, nil
1216
}

0 commit comments

Comments
 (0)