Real-time container failure: failed to write to cpu.rt_runtime_us

I am trying to run a docker container in a real-time mode as shown in the Docker documentation: Configure the realtime scheduler. I have enabled CONFIG_RT_GROUP_SCHED in the kernel and I run the following command:

sudo docker run -it --cpu-rt-runtime=950000 --ulimit rtprio=99 --cap-add=sys_nice debian:jessie

But I am getting the following error:

Docker: Error response from daemon: OCI runtime create failed:
container_linux.go:346: starting container process caused
“process_linux.go:297: applying cgroup configuration for process
caused “failed to write 950000 to cpu.rt_runtime_us: write
/sys/fs/cgroup/cpu,cpuacct/docker/4d65d8ad72d2a79cad05b614a450760868c262c3d781439063a0c14fccbc3dae/cpu.rt_runtime_us:
invalid argument””: unknown.

Am I doing something wrong? Have you managed to run a docker container using real-time scheduler?

(tried on Ubuntu 19.04 (5.0.21) + Docker 19.03.3 and debian 10 Buster (4.19.18) + Docker 19.03.04)