Services.jenkins Additional property runtime is not allowed

I’m trying to run Jenkins through sysbox so I can run docker in docker properly, I followed the install instructions and I’m able to get it to start up from command line but when I add it to my compose file and try and deploy to a swarm I get:

docker stack deploy -c docker-compose.yml build-farm --with-registry-auth:
services.jenkins Additional property runtime is not allowed

my compose file

version: "3.9" 

volumes:
  jenkins-home: 
    external: false
    driver: local
    driver_opts:
      type: none
      o: 'bind'
      device: '/var/jenkins_home'

services:
  jenkins:
    image: git.example.com:8444/devops/docker-services/jenkins
    runtime: sysbox-runc
    build: 
      context: services/jenkins
      args:
        - jenkins_version=2.346.2
        - plugin_cli_version=2.9.3
    volumes:
      - jenkins-home:/var/jenkins_home
    ports:
      - 443:443
      - 636:636
      - 3268:3268
      - 50000:50000
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]

Seems you didn’t check the compose file 3 reference after all, like I suggested in the other thread for a reason…

The docker compose schema version 3.x has no runtime: element. If you need it, you’ll have to use a version 2.x schema (=designed for docker-compose), which does not support swarm deployments.

ok so what do I do to specify runtime

If you read my response from 10 minutes ago, you should have concluded that it’s only available for docker-compose deployment. It is not avilable for swarm deployments.

so what’s the solution for swarm

You can try to change the default runtime in the Docker daemon as it is mentioned in sysbox’s troubleshoot guide: sysbox/troubleshoot.md at master · nestybox/sysbox · GitHub

/etc/docker/daemon.json

{
    "runtimes": {
        "sysbox-runc": {
            "path": "/usr/bin/sysbox-runc"
        }
    }
}

I only tried it with Kata containers in swarm mode. That worked. documentation/ubuntu-docker-install.md at master · kata-containers/documentation · GitHub

You need to restart the Docker daemon after changing the config.

update:

I realized the troubleshoot guide does not change the default runtime. Sou you need to add an other parameter too, which is in the guide of kata containers:

{
    "default-runtime": "sysbox-runc",
    "runtimes": {
        "sysbox-runc": {
            "path": "/usr/bin/sysbox-runc"
        }
    }
}
1 Like