From 33499551443563955adba89227270db0289d0948 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Tue, 25 May 2021 00:54:04 +0000 Subject: [PATCH] stdlib: fix dagger.io/go Signed-off-by: Solomon Hykes --- stdlib/go/go.cue | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/stdlib/go/go.cue b/stdlib/go/go.cue index dbd72114..a183ae54 100644 --- a/stdlib/go/go.cue +++ b/stdlib/go/go.cue @@ -3,6 +3,7 @@ package go import ( "dagger.io/dagger" "dagger.io/dagger/op" + "dagger.io/docker" "dagger.io/os" ) @@ -14,25 +15,22 @@ import ( source: dagger.#Artifact os.#Container & { - env: { - GOMODCACHE: volume.goCache.dest - CGO_ENABLED: "0" + env: CGO_ENABLED: "0" + + image: docker.#Pull & { + from: "docker.io/golang:\(version)-alpine" } - from: "docker.io/golang:\(version)-alpine" + // Setup source dir + let srcPath = "/src" + mount: "\(srcPath)": from: source + dir: srcPath - volume: { - goSource: { - from: source - dest: "/src" - } - goCache: { - type: "cache" - dest: "/root/.cache/gocache" - } - } + // Setup go cache + let cachePath = "/root/.cache/gocache" + cache: "\(cachePath)": true + env: GOMODCACHE: cachePath - dir: volume.goSource.dest // Add go to search path (FIXME: should be inherited from image metadata) shell: search: "/usr/local/go/bin": true }