Skip to content

Commit

Permalink
Merge pull request moby#5738 from crazy-max/dockerfile-device-error-n…
Browse files Browse the repository at this point in the history
…olabs

dockerfile: error out if device feature not used in labs
  • Loading branch information
tonistiigi authored Feb 13, 2025
2 parents 388ec24 + 7fd5f5c commit c45cd57
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 c45cd57

Please sign in to comment.