dockerfile

package
v1.33.3 Latest Latest
Warning

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

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

Documentation

Overview

Package dockerfile provides functionality to parse a Dockerfile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadDockerignore added in v1.33.0

func ReadDockerignore(fs afero.Fs, contextDir string) ([]string, error)

ReadDockerignore reads the .dockerignore file in the context directory and returns the list of paths to exclude.

Types

type Dockerfile

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

Dockerfile represents a parsed Dockerfile.

func New

func New(fs afero.Fs, path string) *Dockerfile

New returns an empty Dockerfile.

func (*Dockerfile) GetExposedPorts

func (df *Dockerfile) GetExposedPorts() ([]Port, error)

GetExposedPorts returns a uint16 slice of exposed ports found in the Dockerfile.

func (*Dockerfile) GetHealthCheck

func (df *Dockerfile) GetHealthCheck() (*HealthCheck, error)

GetHealthCheck parses the HEALTHCHECK instruction from the Dockerfile and returns it. If the HEALTHCHECK is NONE or there is no instruction, returns nil.

type ErrInvalidPort

type ErrInvalidPort struct {
	Match string
}

ErrInvalidPort means that while there was a port provided, it was out of bounds or unparseable

func (ErrInvalidPort) Error

func (e ErrInvalidPort) Error() string

type ErrNoExpose

type ErrNoExpose struct {
	Dockerfile string
}

ErrNoExpose means there were no documented EXPOSE statements in the given dockerfile.

func (ErrNoExpose) Error

func (e ErrNoExpose) Error() string

type HealthCheck

type HealthCheck struct {
	Interval    time.Duration
	Timeout     time.Duration
	StartPeriod time.Duration
	Retries     int
	Cmd         []string
}

HealthCheck represents container health check options in a Dockerfile.

type Port added in v1.11.0

type Port struct {
	Port      uint16
	Protocol  string
	RawString string
	// contains filtered or unexported fields
}

Port represents an exposed port in a Dockerfile.

func (*Port) String added in v1.11.0

func (p *Port) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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