Overview
Part 1 ran an image someone else built. This part builds your own from source withcpln image build, pushes it to your org’s private registry, and runs it as the frontend workload, a Next.js launch page for a product about to open its waitlist. Every later update rolls out the same way, with the version already serving answering until the new one is ready in each location.
What you’ll build:
- A container image of the quickstart frontend, built from its source with no Dockerfile.
- The image stored in your org’s private registry.
- A
frontendworkload serving the launch page from both locations ofquickstart-gvc.
Prerequisites
- Completed 1. Deploy your first workload: the
quickstart-gvcGVC exists. - Docker installed and running, or build on Control Plane with the
--remoteflag in step 4.
Step 1: Install the CLI
The CLI builds the image and pushes it to your org’s private registry.- npm
- Homebrew
- Binary
Requires Node.js version 18 or later (an active LTS release is recommended).
Step 2: Authenticate
Log in to Control Plane:my-org with your org name):
Step 3: Download the frontend
macOS / Linux
Downloads
frontend.tgz, a gzipped tar archive.Windows
Downloads
frontend.zip, the same source as a zip archive.- macOS / Linux
- Windows PowerShell
site.config.ts holds the product name, tagline, description, and three features. The footer names the location that served the request, read from the environment variables Control Plane injects. The waitlist stays closed until part 3 connects the API that stores the signups.
Step 4: Build and push the image
- With Docker
- Without Docker
cpln image build detects the application type from its source and builds the image, so the application needs no Dockerfile: with Docker it uses Buildpacks, and with --remote the Control Plane build service does the detection. When a Dockerfile is present, the command uses that instead. The command ends by printing the image it pushed and its link, where your-org is the name of your org:
--remote, a Pushed your-org.registry.cpln.io/frontend:1.0 in 42s line reports the push just above it.
Your org’s private registry now holds the image. List it:
PULL is the address Docker would pull from. Workloads in your org reference the image as //image/frontend:1.0.
- Console
- CLI
- Terraform
- Pulumi
- AI Agent
Step 5: Create the workload
1
Navigate to Workloads
Click
Workloads in the left menu, then click New.2
Configure basic settings
Enter
frontend as the name and make sure quickstart-gvc is the selected GVC.3
Configure the container
Click
Containers in the left pane and keep Control Plane as the image source. In the image dropdown, type frontend and select frontend:1.0. Under Ports, keep protocol http and number 8080.4
Configure the firewall and create
Click
Firewall in the left pane, click Make Public, then click Create. The workload summary page opens.Step 6: Open the application
1
Wait for deployment
The workload health shows
Ready once the first deployment completes.2
Open the canonical endpoint
Under
Endpoints, click the link next to Canonical Endpoint (Global). The launch page opens in a new window.Verify
Oncefrontend reports Ready, its canonical endpoint serves the launch page: the Launching soon label, the tagline On-call that gets out of your way., a waitlist form that is disabled with the note The waitlist opens once an API is connected. Set API_URL on this workload., three feature cards, and an empty Recent signups section. The footer names the location that served the request, the one nearest to you, for example:
Deployments page, the cpln workload get-deployments frontend --gvc quickstart-gvc output, or the list your AI agent returned, and the footer switches to the other location.
Your own image is in the org’s private registry and running as a globally distributed workload.
Ship a change
Edit the product name or tagline insite.config.ts, then build a new tag:
- With Docker
- Without Docker
- Console
- CLI
- Terraform
- Pulumi
- AI Agent
Open
frontend, click Containers in the left pane, select frontend:1.1 in the image dropdown, and click Update.What you’ve learned
- Private registry: your images are stored within your org.
- Image references: the
//image/prefix for the CLI, the Console, and an AI agent, the full/org/<org>/image/path for Terraform and Pulumi. - No Dockerfile needed:
cpln image builddetects your application’s type and containerizes it, on your machine or on Control Plane. - Rolling versions: an image update creates a new version that takes traffic in a location only once it reports ready there; the previous version serves until then.
- Environment variables: Control Plane injects
CPLN_LOCATION,CPLN_WORKLOAD,CPLN_WORKLOAD_VERSION, and otherCPLN_*variables automatically.
Next steps
3. Service-to-service communication
Build the API, keep it off the internet, and let the frontend reach it by name through the mesh.
Clean up
To remove everything the series has created so far:- Console
- CLI
- Terraform
- Pulumi
- AI Agent
1
Delete the GVC
Open
quickstart-gvc, click Actions, then Delete, type the GVC name to confirm, and click Delete. web and frontend go with it.2
Delete the images
Open
Images, select frontend, and click Actions, then Delete to remove all its tags.A
--remote build also pushes a build cache image, frontend-cache:latest. Delete it with cpln image delete frontend-cache:latest if you built without Docker.