{"modulePath":"github.com/2lambda123/openshift-origin","version":"v3.11.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package dockerfile\n\nPackage dockerfile has utilities that complement Docker's official Dockerfile parser.\n\n## Functions\n\n```go\nfunc Env(m []KeyValue) (string, error)\n```\nEnv builds an ENV Dockerfile instruction from the mapping m. Keys and values are serialized as JSON strings to ensure compatibility with the Dockerfile parser.\n\n```go\nfunc FindAll(node *parser.Node, cmd string) []int\n```\nFindAll returns the indices of all children of node such that node.Children\\[i].Value == cmd. Valid values for cmd are defined in the package github.com/docker/docker/builder/dockerfile/command.\n\n```go\nfunc From(image string) (string, error)\n```\nFrom builds a FROM Dockerfile instruction referring the base image image.\n\n```go\nfunc InsertInstructions(node *parser.Node, pos int, instructions string) error\n```\nInsertInstructions inserts instructions starting from the pos-th child of node, moving other children as necessary. The instructions should be valid Dockerfile instructions. InsertInstructions mutates node in-place, and the final state of node is equivalent to what parser.Parse would return if the original Dockerfile represented by node contained the instructions at the specified position pos. If the returned error is non-nil, node is guaranteed to be unchanged.\n\n```go\nfunc Label(m []KeyValue) (string, error)\n```\nLabel builds a LABEL Dockerfile instruction from the mapping m. Keys and values are serialized as JSON strings to ensure compatibility with the Dockerfile parser.\n\n```go\nfunc Parse(r io.Reader) (*parser.Node, error)\n```\nParse parses the provided stream as a canonical Dockerfile\n\n```go\nfunc Write(node *parser.Node) []byte\n```\nWrite takes a Dockerfile AST node, as generated by parser.Parse, and returns a new, equivalent, Dockerfile.\n\n## Types\n\n```go\ntype KeyValue struct {\n\tKey   string\n\tValue string\n}\n```\nA KeyValue can be used to build ordered lists of key-value pairs.\n\n","path":"github.com/2lambda123/openshift-origin/pkg/build/builder/util/dockerfile","name":"dockerfile","synopsis":"Package dockerfile has utilities that complement Docker's official Dockerfile parser.","isRedistributable":true}
