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/pkg/universe.dagger.io/go/build.cue
Solomon Hykes f6cee7f306 go.#Build: small improvements
Signed-off-by: Solomon Hykes <solomon@dagger.io>
2022-02-23 21:45:13 +00:00

52 lines
792 B
CUE

package go
import (
"dagger.io/dagger"
)
// Build a go binary
#Build: {
// Source code
source: dagger.#FS
// Target package to build
package: *"." | string
// Target architecture
arch: *"amd64" | string
// Target OS
os: *"linux" | string
// Build tags to use for building
tags: *"" | string
// LDFLAGS to use for linking
ldflags: *"" | string
env: [string]: string
container: #Container & {
"source": source
"env": {
env
GOOS: os
GOARCH: arch
}
command: {
args: [package]
flags: {
build: true
"-v": true
"-tags": tags
"-ldflags": ldflags
"-o": "/output/"
}
}
export: directories: "/output": _
}
// Directory containing the output of the build
output: container.export.directories."/output"
}