Add export and load for dagger images
Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
This commit is contained in:
20
docs/drafts/1216-engine-load.md
Normal file
20
docs/drafts/1216-engine-load.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
slug: /1216/engine-load
|
||||
displayed_sidebar: europa
|
||||
---
|
||||
|
||||
# Loading a dagger image into a docker daemon
|
||||
|
||||
Using `docker.#Load`, you can save a dagger image (`docker.#Image`) into a local or remote engine.
|
||||
|
||||
It can be useful to debug or test a build locally before pushing.
|
||||
|
||||
## Local daemon
|
||||
|
||||
```cue file=./plans/local.cue
|
||||
```
|
||||
|
||||
## Remote daemon, via SSH
|
||||
|
||||
```cue file=./plans/ssh.cue
|
||||
```
|
22
docs/drafts/plans/local.cue
Normal file
22
docs/drafts/plans/local.cue
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"universe.dagger.io/docker"
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service
|
||||
|
||||
actions: {
|
||||
build: docker.#Build & {
|
||||
...
|
||||
}
|
||||
|
||||
load: docker.#Load & {
|
||||
image: build.output
|
||||
host: client.filesystem."/var/run/docker.sock".read.contents
|
||||
tag: "myimage"
|
||||
}
|
||||
}
|
||||
}
|
29
docs/drafts/plans/ssh.cue
Normal file
29
docs/drafts/plans/ssh.cue
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"universe.dagger.io/docker"
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
client: filesystem: {
|
||||
"/home/user/.ssh/id_rsa": read: contents: dagger.#Secret
|
||||
"/home/user/.ssh/known_hosts": read: contents: dagger.#Secret
|
||||
}
|
||||
|
||||
actions: {
|
||||
build: docker.#Build & {
|
||||
...
|
||||
}
|
||||
|
||||
load: docker.#Load & {
|
||||
image: build.output
|
||||
tag: "myimage:v2"
|
||||
host: "ssh://root@93.184.216.34"
|
||||
ssh: {
|
||||
key: client.filesystem."/home/user/.ssh/id_rsa".read.contents
|
||||
knownHosts: client.filesystem."/home/user/.ssh/known_hosts".read.contents
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user