magicdir

package
v1.0.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (

	// TempDir is a directory inside the build context inside which
	// we place files referenced by MagicDirectives.
	TempDir = ".envbuilder.tmp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MagicDir

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

MagicDir is a working directory for envbuilder. It will also be present in images built by envbuilder.

var (
	// Default is the default working directory for Envbuilder.
	// This defaults to /.envbuilder. It should only be used when Envbuilder
	// is known to be running as root inside a container.
	Default MagicDir
	// Directives are directives automatically appended to Dockerfiles
	// when pushing the image. These directives allow the built image to be
	// 're-used'.
	Directives = fmt.Sprintf(`
COPY --chmod=0755 %[1]s/envbuilder %[2]s/bin/envbuilder
COPY --chmod=0644 %[1]s/image %[2]s/image
USER root
WORKDIR /
ENTRYPOINT ["%[2]s/bin/envbuilder"]
`, TempDir, defaultMagicDirBase)
)

func At

func At(paths ...string) MagicDir

At returns a MagicDir rooted at filepath.Join(paths...)

func (MagicDir) Built

func (m MagicDir) Built() string

Built is a file that is created in the workspace when envbuilder has already been run. This is used to skip building when a container is restarting. e.g. docker stop -> docker start

func (MagicDir) Features

func (m MagicDir) Features() string

Features is a directory that contains feature files.

func (MagicDir) Image

func (m MagicDir) Image() string

Image is a file that is created in the image when envbuilder has already been run. This is used to skip the destructive initial build step when 'resuming' envbuilder from a previously built image.

func (MagicDir) Join

func (m MagicDir) Join(paths ...string) string

Join returns the result of filepath.Join([m.Path, paths...]).

func (MagicDir) Path

func (m MagicDir) Path() string

String returns the string representation of the MagicDir.

Jump to

Keyboard shortcuts

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