Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Apoxy Images

## Build Locally

### Apoxy API Server

```shell
dagger call build-apiserver --src=. export --path=dist/images/apiserver.tar
```

To import the image into your local Docker daemon:

```shell
skopeo copy oci-archive:dist/images/apiserver.tar docker-daemon:docker.io/apoxy/apiserver:latest
```

### Apoxy Backplane

```shell
dagger call build-backplane --platform=linux/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') --src=. export --path=dist/images/backplane.tar
```

To import the image into your local Docker daemon:

```shell
skopeo copy oci-archive:dist/images/backplane.tar docker-daemon:docker.io/apoxy/backplane:latest
```
9 changes: 6 additions & 3 deletions pkg/backplane/drivers/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ func (d *dockerDriver) Start(
return cname, nil
}

// Pull the image.
if err := exec.CommandContext(ctx, "docker", "pull", imageRef).Run(); err != nil {
return "", fmt.Errorf("failed to pull image %s: %w", imageRef, err)
// Check if we have the image.
if err := exec.CommandContext(ctx, "docker", "image", "inspect", imageRef).Run(); err != nil {
// If not, pull it.
if err := exec.CommandContext(ctx, "docker", "pull", imageRef).Run(); err != nil {
return "", fmt.Errorf("failed to pull image %s: %w", imageRef, err)
}
}

// Check for network and create if not exists.
Expand Down