Documentation ¶
Overview ¶
Package docker is for running Dockerfiles.
Index ¶
- Variables
- func Build(ctx context.Context, args ...string) error
- func BuildHelper(ctx context.Context, directory, tag, configDir string, ...) error
- func BuildPushImageFromInfraImage(ctx context.Context, ...) error
- func Login(ctx context.Context, accessToken, hostname, configDir string) error
- func PublishToTopic(ctx context.Context, image, tag, repo string, topic *pubsub.Topic) error
- func Pull(ctx context.Context, imageWithTag, configDir string) error
- func Push(ctx context.Context, tag, configDir string) (string, error)
- func Run(ctx context.Context, image, configDir string, cmd, volumes, env []string) error
- func Tag(ctx context.Context, imageID, tag, configDir string) error
- type Docker
- func (d *Docker) Build(ctx context.Context, args ...string) error
- func (d *Docker) Cleanup(ctx context.Context) error
- func (d *Docker) Extract(ctx context.Context, image, src, dest string) error
- func (d *Docker) Pull(ctx context.Context, imageWithTag string) error
- func (d *Docker) Push(ctx context.Context, tag string) (string, error)
- func (d *Docker) Run(ctx context.Context, image string, cmd, volumes, env []string) error
- func (d *Docker) Tag(ctx context.Context, imageID, tag string) error
Constants ¶
This section is empty.
Variables ¶
var ( AUTH_SCOPES = []string{auth.ScopeUserinfoEmail, auth.ScopeFullControl} REPOSITORY_HOST = "gcr.io" )
Functions ¶
func Build ¶
Build runs "docker build <args>" in 'directory' and streams the output. The log output is parsed into sub-steps for each line starting with "Step N/M : ACTION value"
Examples:
Step 1/7 : FROM debian:testing-slim ---> e205e0c9e7f5 Step 2/7 : RUN apt-get update && apt-get upgrade -y && apt-get install -y git python curl ---> Using cache ---> 5b8240d40b63
OR
Step 2/7 : RUN apt-get update && apt-get upgrade -y && apt-get install -y git python curl ---> Running in 9402d36e7474 Step 3/7 : RUN mkdir -p --mode=0777 /workspace/__cache Step 5/7 : ENV CIPD_CACHE_DIR /workspace/__cache Step 6/7 : USER skia
func BuildHelper ¶
func BuildHelper(ctx context.Context, directory, tag, configDir string, buildArgs map[string]string) error
Build a Dockerfile.
There must be a Dockerfile in the 'directory' and the resulting output is tagged with 'tag'.
func BuildPushImageFromInfraImage ¶
func BuildPushImageFromInfraImage(ctx context.Context, appName, image, tag, repo, configDir, workDir, infraImageTag string, topic *pubsub.Topic, cmd, volumes, env []string, buildArgs map[string]string) error
BuildPushImageFromInfraImage is a utility function that pulls the infra image, runs the specified buildCmd on the infra image, builds the specified image+tag, pushes it. After pushing it sends a pubsub msg signaling completion.
func PublishToTopic ¶
PublishToTopic publishes a message to the pubsub topic which is subscribed to by https://github.com/google/skia-buildbot/blob/cd593cf6c534ba7a1bd2d88a488d37840663230d/docker_pushes_watcher/go/docker_pushes_watcher/main.go#L335 The tag will be used to determine if the image should be updated.
Types ¶
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}