diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index badb1b2a6b..017503a7f3 100644 --- a/cli/command/container/opts.go +++ b/cli/command/container/opts.go @@ -8,12 +8,12 @@ import ( "path" "path/filepath" "reflect" - "regexp" "strconv" "strings" "time" "github.com/docker/cli/cli/compose/loader" + "github.com/docker/cli/internal/lazyregexp" "github.com/docker/cli/opts" "github.com/docker/docker/api/types/container" mounttypes "github.com/docker/docker/api/types/mount" @@ -40,7 +40,7 @@ const ( seccompProfileUnconfined = "unconfined" ) -var deviceCgroupRuleRegexp = regexp.MustCompile(`^[acb] ([0-9]+|\*):([0-9]+|\*) [rwm]{1,3}$`) +var deviceCgroupRuleRegexp = lazyregexp.New(`^[acb] ([0-9]+|\*):([0-9]+|\*) [rwm]{1,3}$`) // containerOptions is a data object with all the options for creating a container type containerOptions struct {