dockerv1

package
v1.19.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerFileName dockerfile name to be used when directory path is given
	DockerFileName = "Dockerfile"
)
View Source
const (

	// IDConnectorString is string connector used in id creation
	IDConnectorString string = "."
)

Variables

This section is empty.

Functions

func GetresourceIdforDockerfile

func GetresourceIdforDockerfile(filepath string, value string, lineNumber int) (referenceID string)

GetresourceIdforDockerfile Generates hash of the string to be used as the reference id for docker file added line no in creating hash because dockerfile may have same command multiple times with same value

Types

type DockerConfig

type DockerConfig struct {
	Cmd   string `json:"cmd"`
	Value string `json:"value"`
	Line  int    `json:"line"`
}

DockerConfig holds information about individual docker instructions

type DockerV1

type DockerV1 struct {
	// contains filtered or unexported fields
}

DockerV1 struct implements the IacProvider interface

func (*DockerV1) LoadIacDir

func (dc *DockerV1) LoadIacDir(absRootDir string, options map[string]interface{}) (output.AllResourceConfigs, error)

LoadIacDir loads the docker file specified in given folder.

func (*DockerV1) LoadIacFile

func (dc *DockerV1) LoadIacFile(absFilePath string, options map[string]interface{}) (allResourcesConfig output.AllResourceConfigs, err error)

LoadIacFile loads the docker file specified and create ResourceConfig for each dockerfile

func (*DockerV1) Name

func (dc *DockerV1) Name() string

Name returns name of the provider

func (*DockerV1) Parse

func (dc *DockerV1) Parse(filepath string) ([]DockerConfig, string, error)

Parse parses the given dockerfile and gives docker config and string of comments present in dockerfile.

func (*DockerV1) ValidateInstruction

func (dc *DockerV1) ValidateInstruction(node *parser.Node) error

ValidateInstruction validates the dockerfile instructions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL