Stabilize dockerfile heredoc support
Signed-off-by: Justin Chadwell <me@jedevc.com>master
parent
9fb13f77c3
commit
e3fd4a6450
|
@ -7,7 +7,6 @@ run:
|
|||
|
||||
build-tags:
|
||||
- dfrunsecurity
|
||||
- dfheredoc
|
||||
|
||||
linters:
|
||||
enable:
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
//go:build dfheredoc
|
||||
// +build dfheredoc
|
||||
|
||||
package dockerfile
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
//go:build dfheredoc
|
||||
// +build dfheredoc
|
||||
|
||||
package instructions
|
||||
|
||||
import (
|
||||
|
|
|
@ -130,8 +130,17 @@ var validDirectives = map[string]struct{}{
|
|||
}
|
||||
|
||||
var (
|
||||
heredocDirectives map[string]bool // directives allowed to contain heredocs
|
||||
heredocCompoundDirectives map[string]bool // directives allowed to contain directives containing heredocs
|
||||
// Directives allowed to contain heredocs
|
||||
heredocDirectives = map[string]bool{
|
||||
command.Add: true,
|
||||
command.Copy: true,
|
||||
command.Run: true,
|
||||
}
|
||||
|
||||
// Directives allowed to contain directives containing heredocs
|
||||
heredocCompoundDirectives = map[string]bool{
|
||||
command.Onbuild: true,
|
||||
}
|
||||
)
|
||||
|
||||
// directive is the structure used during a build run to hold the state of
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
//go:build dfheredoc
|
||||
// +build dfheredoc
|
||||
|
||||
package parser
|
||||
|
||||
import "github.com/moby/buildkit/frontend/dockerfile/command"
|
||||
|
||||
func init() {
|
||||
heredocDirectives = map[string]bool{
|
||||
command.Add: true,
|
||||
command.Copy: true,
|
||||
command.Run: true,
|
||||
}
|
||||
|
||||
heredocCompoundDirectives = map[string]bool{
|
||||
command.Onbuild: true,
|
||||
}
|
||||
}
|
|
@ -1,6 +1,3 @@
|
|||
//go:build dfheredoc
|
||||
// +build dfheredoc
|
||||
|
||||
package parser
|
||||
|
||||
import (
|
||||
|
|
|
@ -1 +1 @@
|
|||
dfrunsecurity dfheredoc
|
||||
dfrunsecurity
|
||||
|
|
Loading…
Reference in New Issue