dockerfile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dockerfile provides simple Dockerfile parsing functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dockerfile

type Dockerfile struct {
	ExposedPorts []portConfig
	HealthCheck  *HealthCheck
	// 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() ([]uint16, error)

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

func (*Dockerfile) GetHealthCheck added in v0.1.0

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 added in v0.1.0

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

HealthCheck represents health check options for a Dockerfile.

Jump to

Keyboard shortcuts

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