stdlib: improved Docker package

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-04-06 21:20:21 +00:00
parent d522fc3396
commit 647e4c898b
7 changed files with 49 additions and 122 deletions

1
examples/dagger-dev/dev.cue Symbolic link
View File

@@ -0,0 +1 @@
../../dev.cue

View File

@@ -1,46 +0,0 @@
package main
// A dagger configuration to build and test the dagger source code.
// This configuration can easily be adapted to build and test any go project.
//
//
// Example:
// dagger compute ./examples/dagger-dev --input-dir repository=/path/to/go/project
import (
"dagger.io/dagger"
"dagger.io/go"
"dagger.io/docker"
)
repository: dagger.#Artifact
// Build `dagger` using Go
build: go.#Build & {
source: repository
packages: "./cmd/dagger"
output: "/usr/local/bin/dagger"
}
// Run go tests
test: go.#Test & {
source: repository
packages: "./..."
}
// Run a command with the binary we just built
help: docker.#Run & {
image: build
args: ["dagger", "-h"]
}
// Build dagger using the (included) Dockerfile
buildWithDocker: docker.#Build & {
source: repository
}
// Run a command in the docker image we just built
helpFromDocker: docker.#Run & {
image: buildWithDocker.image
args: ["dagger", "-h"]
}