This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/docs/reference/dagger/op.md
Andrea Luzzardi 5a1d4bff62 Support loading artifacts into a Docker Engine
This adds support to loading artifacts (e.g. docker.#Build,
os.#Container, ...) into any arbitrary docker engine (through a
dagger.#Stream for UNIX sockets or SSH for a remote engine)

Implementation:
- Add op.#SaveImage which serializes an artifact into an arbitrary path
  (docker tarball format)
- Add docker.#Load which uses op.#SaveImage to serialize to disk and
  executes `docker load` to load it back

Caveats: Because we're doing this in userspace rather than letting
dagger itself load the image, the performance is pretty bad.

The buildkit API is meant for streaming (get a stream of a docker image
pipe it into docker load). Because of userspace, we have to load the
entire docker image into memory, then serialize it in a single WriteFile
LLB operation.

Example:

```cue
package main

import (
	"alpha.dagger.io/dagger"
	"alpha.dagger.io/docker"
)

source: dagger.#Input & dagger.#Artifact

dockersocket: dagger.#Input & dagger.#Stream

build: docker.#Build & {
	"source": source
}

load: docker.#Load & {
	source: build
	tag:    "testimage"
	socket: dockersocket
}
```

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-10-12 14:16:01 -07:00

1.8 KiB

sidebar_label
op

alpha.dagger.io/dagger/op

op: low-level operations for Dagger processing pipelines

import "alpha.dagger.io/dagger/op"

op.#Copy

op.#Copy Inputs

No input.

op.#Copy Outputs

No output.

op.#DockerBuild

op.#DockerBuild Inputs

No input.

op.#DockerBuild Outputs

No output.

op.#DockerLogin

op.#DockerLogin Inputs

No input.

op.#DockerLogin Outputs

No output.

op.#Exec

op.#Exec Inputs

No input.

op.#Exec Outputs

No output.

op.#Export

Export a value from fs state to cue

op.#Export Inputs

No input.

op.#Export Outputs

No output.

op.#FetchContainer

op.#FetchContainer Inputs

No input.

op.#FetchContainer Outputs

No output.

op.#FetchGit

op.#FetchGit Inputs

No input.

op.#FetchGit Outputs

No output.

op.#FetchHTTP

op.#FetchHTTP Inputs

No input.

op.#FetchHTTP Outputs

No output.

op.#Load

op.#Load Inputs

No input.

op.#Load Outputs

No output.

op.#Local

op.#Local Inputs

No input.

op.#Local Outputs

No output.

op.#Mkdir

op.#Mkdir Inputs

No input.

op.#Mkdir Outputs

No output.

op.#Op

One operation in a pipeline

op.#Op Inputs

No input.

op.#Op Outputs

No output.

op.#PushContainer

op.#PushContainer Inputs

No input.

op.#PushContainer Outputs

No output.

op.#SaveImage

op.#SaveImage Inputs

No input.

op.#SaveImage Outputs

No output.

op.#Subdir

op.#Subdir Inputs

No input.

op.#Subdir Outputs

No output.

op.#Workdir

op.#Workdir Inputs

No input.

op.#Workdir Outputs

No output.

op.#WriteFile

op.#WriteFile Inputs

No input.

op.#WriteFile Outputs

No output.