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/alpine/alpine.cue

44 lines
951 B
CUE
Raw Normal View History

// Base package for Alpine Linux
package alpine
import (
"universe.dagger.io/docker"
)
_platforms: {
"linux/amd64": "3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
"linux/arm64/v8": "3.15.0@sha256:c74f1b1166784193ea6c8f9440263b9be6cae07dfe35e32a5df7a31358ac2060"
}
// Build an Alpine Linux container image
#Build: {
// Platform to support
platform: string | *"linux/amd64"
// Alpine version to install. Setting this will override platform.
version: string | *_platforms[platform]
// List of packages to install
packages: [pkgName=string]: version: string | *""
docker.#Build & {
steps: [
docker.#Pull & {
source: "index.docker.io/alpine:\(version)"
},
for pkgName, pkg in packages {
docker.#Run & {
cmd: {
name: "apk"
args: ["add", "\(pkgName)\(pkg.version)"]
flags: {
"-U": true
"--no-cache": true
}
}
}
},
]
}
}