Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultDockerfileSyntax is the default syntax for Dockerfiles used by Porter // either when generating a Dockerfile from scratch, or when a template does // not define a syntax DefaultDockerfileSyntax = "docker/dockerfile-upstream:1.4.0" )
Variables ¶
View Source
var ( // DOCKER_FILE is the file generated before running a docker build. DOCKER_FILE = filepath.Join(LOCAL_CNAB, "Dockerfile") // LOCAL_CNAB is the generated directory where porter stages the /cnab directory. LOCAL_CNAB = ".cnab" // LOCAL_APP is the generated directory where porter stages the /cnab/app directory. LOCAL_APP = filepath.Join(LOCAL_CNAB, "app") // LOCAL_BUNDLE is the generated bundle.json file. LOCAL_BUNDLE = filepath.Join(LOCAL_CNAB, "bundle.json") // LOCAL_RUN is the path to the generated CNAB entrypoint script, located at /cnab/app/run. LOCAL_RUN = filepath.Join(LOCAL_APP, "run") // LOCAL_MANIFEST is the canonical Porter manifest generated from the // user-provided manifest and any dynamic overrides LOCAL_MANIFEST = filepath.Join(LOCAL_APP, "porter.yaml") // LOCAL_MIXINS is the path where Porter stages the /cnab/app/mixins directory. LOCAL_MIXINS = filepath.Join(LOCAL_APP, "mixins") // BUNDLE_DIR is the directory where the bundle is located in the CNAB execution environment. BUNDLE_DIR = "/cnab/app" // PORTER_MIXINS_TOKEN can control where mixin instructions will be placed in // Dockerfile. PORTER_MIXINS_TOKEN = "# PORTER_MIXINS" // PORTER_INIT_TOKEN controls where Porter's image initialization // instructions are placed in the Dockerfile. PORTER_INIT_TOKEN = "# PORTER_INIT" )
Functions ¶
This section is empty.
Types ¶
type BuildImageOptions ¶ added in v1.0.1
type BuildImageOptions struct {
// SSH is the set of docker build --ssh flags specified.
SSH []string
// Secrets is the set of docker build --secret flags specified.
Secrets []string
// BuildArgs is the set of docker build --build-arg specified.
BuildArgs []string
// BuildContexts is the set of docker build --build-context specified.
BuildContexts []string
// NoCache is the docker build --no-cache flag specified.
NoCache bool
// Builder is the name of the buildkit builder to use
Builder string
// CacheFrom is the set of docker build --cache-from flags specified.
CacheFrom []string
// CacheTo is the set of docker build --cache-to flags specified.
CacheTo []string
// Output is a subset of docker build --output options.
Output string
}
BuildImageOptions represents some flags exposed by docker.
type Builder ¶ added in v1.0.1
type Builder interface {
// BuildBundleImage using the bundle in the build context directory
BuildBundleImage(ctx context.Context, manifest *manifest.Manifest, opts BuildImageOptions) error
// TagBundleImage using the origTag and newTag values supplied
TagBundleImage(ctx context.Context, origTag, newTag string) error
}
type DockerfileGenerator ¶
type DockerfileGenerator struct {
*config.Config
*manifest.Manifest
*templates.Templates
Mixins pkgmgmt.PackageManager
}
func NewDockerfileGenerator ¶
func NewDockerfileGenerator(config *config.Config, m *manifest.Manifest, tmpl *templates.Templates, mp pkgmgmt.PackageManager) *DockerfileGenerator
func (*DockerfileGenerator) GenerateDockerFile ¶
func (g *DockerfileGenerator) GenerateDockerFile(ctx context.Context) error
func (*DockerfileGenerator) PrepareFilesystem ¶
func (g *DockerfileGenerator) PrepareFilesystem() error
Click to show internal directories.
Click to hide internal directories.