Apply Solomon comments on universe.dagger.io/go

- Improve #Container with a better docker.#Run integration
- Supports concurrency caching in #Container
- Simplify code maintainability and readability
- Simplify binary export in #Build
- Support multi binary building
- External #Version management

Signed-off-by: Vasek - Tom C <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2022-02-17 15:56:19 +01:00
committed by Vasek - Tom C
parent e49bb34e87
commit 2887139bf7
8 changed files with 45 additions and 42 deletions

View File

@@ -2,7 +2,6 @@ package go
import (
"dagger.io/dagger"
"dagger.io/dagger/engine"
"universe.dagger.io/go"
"universe.dagger.io/docker"
"universe.dagger.io/alpine"
@@ -17,24 +16,23 @@ dagger.#Plan & {
simple: {
build: go.#Build & {
source: inputs.directories.testhello.contents
output: "/bin/hello"
}
exec: docker.#Run & {
input: _baseImage.output
command: {
name: "/bin/sh"
args: ["-c", "hello >> /output.txt"]
args: ["-c", "/bin/hello >> /output.txt"]
}
env: NAME: "dagger"
mounts: binary: {
dest: build.output
dest: "/bin/hello"
contents: build.binary
source: "/bin/hello"
source: "/test"
}
}
verify: engine.#ReadFile & {
verify: dagger.#ReadFile & {
input: exec.output.rootfs
path: "/output.txt"
} & {