NOTICE: werf currently supports building images with the Docker server or without the Docker server (in experimental mode). This page contains information applicable only to the experimental mode without the Docker server. For now, only the Dockerfile image builder is available for this mode. The Stapel image builder will be available soon.

1. Configure GitLab rinner for Kubernetes

Make sure you meet all system requirements and select one of the available operating modes (depending on the capabilities of your GitLab runner) and navigate to it.

Linux kernel with rootless OverlayFS

Basic runner configuration:

[[runners]]
  name = "docker-runner-for-werf"
  executor = "docker"
  ...
  [runners.docker]
    security_opt = ["seccomp:unconfined", "apparmor:unconfined"]
    ...

Linux kernel without rootless OverlayFS and privileged container

Basic runner configuration:

[[runners]]
  name = "docker-runner-for-werf"
  executor = "docker"
  ...
  [runners.docker]
    privileged = true
    ...

Linux kernel without rootless OverlayFS and non-privileged container

Basic runner configuration:

[[runners]]
  name = "docker-runner-for-werf"
  executor = "docker"
  ...
  [runners.docker]
    security_opt = ["seccomp:unconfined", "apparmor:unconfined"]
    devices = ["/dev/fuse"]
    ...

2. Configure access to the Kubernetes cluster

Assign the WERF_KUBECONFIG_BASE64 environment variable in the GitLab project a base64-encoded value from ~/.kube/config. werf will automatically use this configuration to connect to the Kubernetes cluster.

3. Configure gitlab-ci.yml of the project

Below is a basic build and deploy job for a project:

stages:
  - build-and-deploy

Build and deploy application:
  stage: build-and-deploy
  image: registry.werf.io/werf/werf
  script:
    - source $(werf ci-env gitlab --as-file)
    - werf converge
  tags: ["docker-runner-for-werf"]

Troubleshooting

In case of problems, refer to the Troubleshooting section