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/stdlib
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
..
.dagger/env added test for docker run with ports 2021-09-28 09:33:02 -06:00
alpine Move tests plan from dagger dir to universe 2021-06-25 17:00:38 +02:00
argocd argocd.#Sync now retrieve status 2021-09-10 09:10:21 -07:00
aws fix ecr typo on localMode 2021-09-23 00:14:44 +02:00
azure Adding support for azure static webapp 2021-09-13 10:39:20 -07:00
cue.mod commit missing cue.mod 2021-07-08 17:52:21 +02:00
dagger Support loading artifacts into a Docker Engine 2021-10-12 14:16:01 -07:00
docker Support loading artifacts into a Docker Engine 2021-10-12 14:16:01 -07:00
gcp Add zone in GCP.#Config 2021-09-14 13:43:31 +02:00
git Improve/git: Git.#Repository's origin now uses the provided URL 2021-10-04 16:45:34 +02:00
go os.#Container: inherit PATH from the container image 2021-08-04 16:56:52 +02:00
io stdlib: added package doc strings 2021-06-15 10:46:56 +02:00
java/maven Check if problem is linked with docker from docker 2021-06-29 16:26:31 +00:00
js/yarn Update import to alpha version 2021-06-25 17:26:51 +02:00
kubernetes Update documentation 2021-09-22 20:29:20 +02:00
netlify Fix/Netlify package: reinsert always:true 2021-09-23 19:24:48 +02:00
os Add test on git.#Commit 2021-09-03 02:29:31 +02:00
random stdlib: move all imports to alpha.dagger.io 2021-06-25 10:31:22 +00:00
terraform Update import to alpha version 2021-06-25 17:26:51 +02:00
.gitignore Move universe integration tests to universe dir. 2021-06-09 20:28:44 +00:00
helpers.bash logger: TTY logs support (live update) 2021-10-05 15:38:34 -07:00
package.json Move universe integration tests to universe dir. 2021-06-09 20:28:44 +00:00
stdlib.go universe vendoring 2021-07-08 17:52:21 +02:00
universe.bats one last var needed quotes 2021-09-28 10:00:26 -06:00
yarn.lock Move universe integration tests to universe dir. 2021-06-09 20:28:44 +00:00