stdlib: add alpine

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-02-18 18:32:07 -08:00
parent a3e78cc558
commit 272f387737
3 changed files with 47 additions and 23 deletions

30
stdlib/alpine/alpine.cue Normal file
View File

@@ -0,0 +1,30 @@
package alpine
import (
"dagger.io/dagger"
)
let defaultVersion = "3.13.2@sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be"
#Image: {
package: [string]: true | false | string
version: string | *defaultVersion
#dagger: compute: [
dagger.#FetchContainer & {
ref: "index.docker.io/alpine:\(version)"
},
for pkg, info in package {
if (info & true) != _|_ {
dagger.#Exec & {
args: ["apk", "add", "-U", "--no-cache", pkg]
}
}
if (info & string) != _|_ {
dagger.#Exec & {
args: ["apk", "add", "-U", "--no-cache", "\(pkg)\(info)"]
}
}
},
]
}