Skip to main content

Overview

Part 1 ran an image someone else built. This part builds your own from source with cpln 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 frontend workload serving the launch page from both locations of quickstart-gvc.
The source folder frontend is built into the image frontend:1.0 in the org's private registry, and the image runs as the workload frontend. One build into your registry, and a workload that runs it in every location.

Prerequisites

Step 1: Install the CLI

The CLI builds the image and pushes it to your org’s private registry.
Requires Node.js version 18 or later (an active LTS release is recommended).
Confirm the installation:
The CLI version number prints.

Step 2: Authenticate

Log in to Control Plane:
The CLI prints a login URL and a six-digit confirmation code, then waits. Open the URL in a browser on any device, sign in, and enter the code. After the CLI confirms the login, set your default org (replace 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.
Extract the archive and navigate to the directory:
The frontend is a Next.js site: the launch page of a product called Beacon, with a waitlist form. 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

The build runs through Docker on your machine and pushes the result to your org’s private registry.
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:
With --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.

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

Once frontend 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:
Open each location’s endpoint from the 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 in site.config.ts, then build a new tag:
Update the workload to the new image:
Open frontend, click Containers in the left pane, select frontend:1.1 in the image dropdown, and click Update.
The version already serving keeps answering until the new one reports ready in each location. Then the header and footer carry your product name, the hero shows your tagline, and the version in the footer has increased.

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 build detects 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 other CPLN_* 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:
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.