- Native support with any Docker installation, no extra tools needed
- Infrastructure-as-code for docker images
- Cache-efficient: Represent any build graph in dacc
- Extend: merge, diff, and nested builds operations
A very parallel build (src) generated with dacc
dacc requires Docker.
npm install dacc
Create a new project with the create-dacc
, which will create a new TypeScript project and install dacc in the directory provided.
npx create-dacc hello-dacc
Enter the newly created directory and run the build
cd hello-dacc && npm start
- Merging / Parallelism
- Diff Layers
- Generating protobuf definitions for this repository
- Building the Buildkit Frontend Image
- Multi-platform
- Nested builds
- Directory of additional examples
Docker images often have to install packages via a package manager. This might be specified in a single command RUN apk add git curl wget
. But when a new package is added, the entire cache is invalidated.
Instead, with dacc, you can install them in parallel and then merge the resulting filesystems. Adding or removing packages from the list won't invalidate the cache for the other packages.
import { cacheMount, State } from 'dacc'
async function main() {
const s = (await new State().from("alpine"))
const bins = ["git", "curl", "wget"]
s.merge(
s.parallel(
...bins.map(bin => (s: State) =>
s.run(`apk add ${bin}`).with(cacheMount("/var/cache/apk")))
),
)
s.image.run({
run: { command: "ls", args: bins.map(bin => `/usr/bin/${bin}`) },
})
}
void main()