{"id":21193644,"url":"https://github.com/danielmschmidt/cdktf-local-build","last_synced_at":"2025-07-10T03:32:54.678Z","repository":{"id":38164559,"uuid":"443172713","full_name":"DanielMSchmidt/cdktf-local-build","owner":"DanielMSchmidt","description":"A construct that encapsulates different building methods, e.g. for Node, Rust, Docker.","archived":false,"fork":false,"pushed_at":"2022-05-24T00:08:31.000Z","size":1244,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-13T02:21:40.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielMSchmidt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-30T19:59:01.000Z","updated_at":"2022-06-13T09:40:11.000Z","dependencies_parsed_at":"2022-08-31T22:20:52.094Z","dependency_job_id":null,"html_url":"https://github.com/DanielMSchmidt/cdktf-local-build","commit_stats":null,"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fcdktf-local-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fcdktf-local-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fcdktf-local-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMSchmidt%2Fcdktf-local-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielMSchmidt","download_url":"https://codeload.github.com/DanielMSchmidt/cdktf-local-build/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225615164,"owners_count":17496946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T19:15:07.834Z","updated_at":"2024-11-20T19:15:08.932Z","avatar_url":"https://github.com/DanielMSchmidt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CDKTF Local Build Construct\n\nA simple construct that runs builds for different languages locally.\nCurrently, it supports: docker. I plan on adding rust (cargo) and node (npm) support as well.\n\n## Usage\n\n```ts\nimport { Provider, DockerBuild, DockerizedBuild } from \"cdktf-local-build\";\n\n// Local Build extends LocalExec which extends from the null provider,\n// so if you already have the provider initialized you can skip this step\nnew Provider(this, \"local-build\");\n\nnew DockerBuild(this, \"docker-backend\", {\n  cwd: \"/path/to/project/backend\",\n  dockerfile: \"Dockerfile.backend\",\n  image: \"cdktf/backend:latest\",\n  push: false, // defaults to true\n});\n\nnew DockerizedBuild(this, \"my-go-backend\", {\n  cwd: \"/path/to/project/backend\",\n  command: \"go build -o /tmp/backend\",\n  imageHomeDirectory: \"/tmp/backend\",\n  platform: \"linux/arm64\",\n  image: \"go-builder-image:latest\",\n  setUser: true,\n});\n```\n\n### `DockerBuild`\n\nBuilds a docker image locally.\n\n#### Options\n\n- `cwd`: The working directory to run the command in.\n- `dockerfile`: The Dockerfile to use.\n- `image`: The tag to use for the image.\n- `push`: If true, `docker push \u003ctag\u003e` is executed after the run.\n\n### `DockerizedBuild`\n\nBuild an artifact inside a docker image.\n\n#### Options\n\n- `cwd`: The working directory to run the command in.\n- `command`: Build command to run int the docker image.\n- `image`: The tag to use for the building image.\n- `imageHomeDirectory`: The home directory to use inside the image.\n- `platform`: The platform to build for (sets docker platform flag).\n- `setUser`: If true, the user will be set to the current user inside docker.\n\n### `CrossBuild`\n\nBuilds a rust binary using cross (cross runs it inside a docker container).\nPlease make sure [cross](https://github.com/cross-rs/cross) is installed on the host machine by running `cargo install cross`.\n\n#### Options\n\n- `arch`: The architecture to build for (`arm` or `x86`).\n- `projectName`: The name specified in the Cargo.toml.\n- `cwd`: The working directory to run the command in.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmschmidt%2Fcdktf-local-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielmschmidt%2Fcdktf-local-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmschmidt%2Fcdktf-local-build/lists"}