Skip to content

Build

Builds run on the platform, not in your CI and not on your machine. OpenChoreo describes the general model under CI Overview.

What a build does

  1. Fetch the source — branch main (or the branch/commit set on the component) from gitlab.ccc-onconnect.de/onconnect/apps/<project>, using the project's deploy token (secret git-<project>).
  2. Build the image — with Podman and your Dockerfile.
  3. Store the image — in the project's GitLab registry. Running pods pull it as registry.onconnect.local:5000/onconnect/apps/<project>/<component>:v1-<commit>.
  4. Generate the workload — from the image and workload.yaml (step generate-workload), and from that a new release.
  5. With Auto Deploy, the release goes to development immediately.

You start builds in the portal under Component → Build. An automatic build on every push (webhook) is currently not set up. The portal shows the logs of every build step; finished builds are cleaned up after one day.

Build workflows

Workflow When
dockerfile-builder Recommended. You have full control over the image.
paketo-buildpacks-builder, gcp-buildpacks-builder Without a Dockerfile, if buildpacks detect your stack.
ballerina-buildpack-builder Ballerina services (type service only).

Parameters of dockerfile-builder:

Parameter Default Meaning
repository.url — https://gitlab.ccc-onconnect.de/onconnect/apps/<project>.git
repository.secretRef — git-<project>
repository.revision.branch main branch that is built
repository.revision.commit empty a specific commit instead of the branch head
repository.appPath . directory of the application (where workload.yaml lives)
docker.context . build context
docker.filePath ./Dockerfile path to the Dockerfile
buildArgs [] --build-arg for ARG instructions
buildEnv [] environment variables for the RUN steps

Network during builds: proxy

The build reaches the internet only through the corporate proxy http://proxy.kite.ume.de:3128. The proxy variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) are already set in the build environment and passed on to the RUN steps. apk, apt, pip, npm, go, maven and others therefore work without further ado, and base images from Docker Hub, GHCR etc. can be pulled.

Node.js, Corepack and Yarn Berry

Node (including fetch and therefore Corepack) and Yarn Berry ignore the usual proxy variables. Set under buildEnv on the component:

buildEnv:
  - name: NODE_USE_ENV_PROXY
    value: "1"
  - name: YARN_HTTP_PROXY
    value: http://proxy.kite.ume.de:3128
  - name: YARN_HTTPS_PROXY
    value: http://proxy.kite.ume.de:3128

If your application downloads something at runtime as well (e.g. yarn start via Corepack), you also need the same variables in configurations.env of the workload.yaml.

Build arguments

Build arguments (buildArgs) are set on the component, e.g. a token for a private npm registry:

buildArgs:
  - name: NPM_TOKEN
    value: <token>
ARG NPM_TOKEN
RUN echo "//gitlab.example.org/api/v4/packages/npm/:_authToken=${NPM_TOKEN}" > .npmrc \
 && yarn install --immutable \
 && rm -f .npmrc

Build arguments are plain text

buildArgs are stored in plain text on the component and are visible to all members of the project. Only use tokens with minimal permissions (e.g. read_api or read-only access to the package registry), and make sure the value does not end up in the final image (multi-stage build, delete .npmrc). Runtime secrets do not belong here, see Configuration and secrets.

Notes on the Dockerfile

  • Use multi-stage builds: build in a large image, ship in a small one.
  • Port: the container must listen on the port named in workload.yaml.
  • Run unprivileged: ports ≥ 1024, e.g. nginxinc/nginx-unprivileged (port 8080) instead of nginx.
  • Workspace: each build has 10 GiB for the checkout, image layers and the export. Keep the context small with a .dockerignore (node_modules, .git, build output).
  • Platform: images are built for linux/amd64.

A complete example is this guide itself:

FROM python:3.12-slim AS build
WORKDIR /src
RUN pip install --no-cache-dir "mkdocs>=1.6,<2" "mkdocs-material~=9.6" "mkdocs-static-i18n~=1.3"
COPY mkdocs.yml ./
COPY docs ./docs
RUN mkdocs build --strict --site-dir /site

FROM nginxinc/nginx-unprivileged:1.27-alpine
COPY --from=build /site /usr/share/nginx/html
EXPOSE 8080

Private repositories

All project repositories are private. The platform team sets up the build's read access together with the project (deploy token, secret git-<project>); you do not need to do anything. The general procedure is described under Private Git Repository.