memory-bank/components/image-builder-bob.md
The Image-Builder-Bob component in Gitpod is a CLI tool responsible for building and pushing workspace images during workspace startup. It operates within a headless workspace created by the image-builder-mk3 component and handles the building of custom Docker images based on user-defined Dockerfiles in .gitpod.yml. The component consists of two main parts: a build process that creates the images and a proxy that handles authentication for pushing the images to registries.
The primary purposes of the Image-Builder-Bob component are:
The Image-Builder-Bob component consists of several key parts:
The component operates in a headless workspace where:
bob proxy runs in ring1 (started by workspacekit) and receives credentials for pushing imagesbob build runs as a workspace task and builds the images, pushing them to bob proxy.gitpod.yml/workspace/.gitpod/bob.logThe Image-Builder-Bob component is configured through environment variables:
BOB_TARGET_REF: Reference for the target imageBOB_BASE_REF: Reference for the base imageBOB_BUILD_BASE: Whether to build the base imageBOB_DOCKERFILE_PATH: Path to the DockerfileBOB_CONTEXT_DIR: Directory to use as build contextBOB_EXTERNAL_BUILDKITD: External Buildkit daemon to useBOB_LOCAL_CACHE_IMPORT: Local cache import configurationTHEIA_WORKSPACE_ROOT: Workspace root directoryBOB_BASELAYER_AUTH: Authentication for the base layer registryBOB_WSLAYER_AUTH: Authentication for the workspace layer registryBOB_AUTH_KEY: Key for decrypting authentication tokensWORKSPACEKIT_BOBPROXY_BASEREF: Base image reference for the proxyWORKSPACEKIT_BOBPROXY_TARGETREF: Target image reference for the proxyWORKSPACEKIT_BOBPROXY_AUTH: Authentication for the proxyWORKSPACEKIT_BOBPROXY_ADDITIONALAUTH: Additional authentication for the proxyBOB_BASE_REF=localhost:5000/source:latest BOB_TARGET_REF=localhost:5000/target:83 bob build
bob proxy --base-ref=localhost:5000/source:latest --target-ref=localhost:5000/target:83 --auth='{"username":"user","password":"pass"}'
image-builder-mk3 creates a headless workspacebob proxy starts in ring1 with registry credentialsbob build runs as a workspace taskbob proxy to the registryThe Image-Builder-Bob component integrates with:
bob proxy in ring1components/common-go: Common Go utilitiesThe component implements several security measures:
bob proxy, not to user codeThe build process consists of two main steps:
The base layer can be either a previously built custom Dockerfile or a public image. The built images do not include components like supervisor or the IDE, as these layers are added by registry-facade during image pull.
The proxy acts as an intermediary between bob build and the actual container registry:
bob build on localhostbob proxy in ring1