Cannot deploy docker compose: "Can not obtain UID from 'root'"

here’s simplified docker-compose.yml

version: '3.8'
services:
  mysql:
    build: ./docker/mysql-data
    container_name: mysql
    restart: always
    user: root
    cap_add:
      - SYS_NICE
    volumes:
      - ./docker/mysql-data/sql:/docker-entrypoint-initdb.d/
      - ./docker/mysql:/var/lib/mysql
      - ./docker/mysql-data/mysqld.cnf:/etc/mysql/my.cnf
    environment:
      - 'MYSQL_DATABASE=dev'
      - 'MYSQL_ROOT_PASSWORD=root'
    ports:
      - "3306:3306"

when I try to deploy:

# okteto deploy --build
 i  Using shipitsin-ilia @ cloud.okteto.com as context
 x  Can not obtain UID from 'root'
#

what’s wrong ?

Where are you running this on? Okteto Cloud, or your own cluster?

This error is typically displayed when the Dockerfile you are using doesn’t have a user named “root”.

  1. Can you check if this is the case in your Dockerfile and base images?
  2. Have you tried running it without overriding the user?

Separately, the SYS_NICE capability is not supported on Okteto Cloud.