Build a Docker image with Docker Build Cloud (DBC)
An example that builds a Dockerfile in Docker Build Cloud.
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set dockerbuildcloud-tscd pulumi-examples/dockerbuildcloud-tsBuilds a Docker image from a local NGINX Dockerfile using Docker Build Cloud (DBC). This template prompts you for an existing DBC builder.
Prerequisites#
- Install Pulumi
- Install Node.js
- A Docker Build Cloud (DBC) builder — you must complete the DBC builder setup steps
- Docker Desktop / CLI
- Recommended: a Pulumi Cloud account
Deploying the example#
This Pulumi example is written as a template. It is meant to be copied via pulumi new as follows:
pulumi new https://github.com/pulumi/examples/tree/master/dockerbuildcloud-tsnpm installOnce copied to your machine, feel free to edit as needed.
-
Create a new stack, which is an isolated deployment target for this example:
Terminal window pulumi stack init dev -
Set the name of your existing (and configured) cloud builder:
Terminal window pulumi config set builder cloud-pulumi-my-cool-builder -
Install dependencies:
Terminal window npm install -
Deploy your infrastructure by running
pulumi upand selecting “yes” to confirm the expected changes:Terminal window pulumi up
Cleaning up#
Once you are done, you can destroy all of the resources, and the stack:
pulumi destroypulumi stack rm