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

186 lines
1.8 KiB
Markdown

---
sidebar_label: op
---
# alpha.dagger.io/dagger/op
op: low-level operations for Dagger processing pipelines
```cue
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._