Skip to content

Commit

Permalink
dockerfile: error out if device feature not used in labs
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
  • Loading branch information
crazy-max authored and tonistiigi committed Feb 13, 2025
1 parent 280ebbf commit 7fd5f5c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/dockerfile/dockerfile2llb/convert_norundevice.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ package dockerfile2llb
import (
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/frontend/dockerfile/instructions"
"github.com/pkg/errors"
)

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

0 comments on commit 7fd5f5c

Please # to comment.