Drone

Docker runner resource limit does not work

This is my simple docker compose file:

version: '2.4'

services:
  drone-server:
    image: drone/drone:1
    restart: unless-stopped
    networks:
      - default
      - web
    environment:
      - DRONE_USER_CREATE=$DRONE_USER_CREATE
      - DRONE_USER_FILTER=$DRONE_USER_FILTER
      - DRONE_GITHUB_CLIENT_ID=$DRONE_GITHUB_CLIENT_ID
      - DRONE_GITHUB_CLIENT_SECRET=$DRONE_GITHUB_CLIENT_SECRET
      - DRONE_RPC_SECRET=$DRONE_RPC_SECRET
      - DRONE_SERVER_HOST=xxxx
      - DRONE_SERVER_PROTO=https

  drone-runner:
    image: drone/drone-runner-docker:1
    restart: unless-stopped
    networks:
      - web
      - default
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_RPC_SECRET=$DRONE_RPC_SECRET
      - DRONE_RPC_PROTO=http
      - DRONE_RPC_HOST=drone-server
      - DRONE_RUNNER_NAME=drone-runner
      - DRONE_RUNNER_CAPACITY=2
      - DRONE_CPU_SHARES=16
      - DRONE_MEMORY_LIMIT=4000000000
      - DRONE_MEMORY_SWAP_LIMIT=0

apparently the created containers always use maximum resource from my server rather than the amount that I specify in the variable (4GB).

e5a5bc96db27        drone-onFA28oii6HGBBvU7Mdu     271.95%             355.6MiB / 251.9GiB   0.14%               918B / 0B           0B / 0B             55