services: yocto: image: hub.anxietyprime.de/yocto:latest container_name: yocto runtime: nvidia # Enable GPU support network_mode: host devices: - /dev/dri - /dev/kvm:/dev/kvm - /dev/net/tun:/dev/net/tun privileged: true cap_add: - SYS_ADMIN - NET_ADMIN environment: - DISPLAY=${DISPLAY} - XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} - NVIDIA_VISIBLE_DEVICES=all - NVIDIA_DRIVER_CAPABILITIES=all - LIBGL_ALWAYS_INDIRECT=1 - __GLX_VENDOR_LIBRARY_NAME=nvidia volumes: # display (if needed) - /tmp/.X11-unix:/tmp/.X11-unix - ${XDG_RUNTIME_DIR}:${XDG_RUNTIME_DIR} # devices - /dev:/dev # cache - ./.cache/:/home/yocto/ws/.cache - ./.cache/docker/zsh_history:/home/yocto/.zsh_history # ws - ./build/:/home/yocto/ws/build - ./layers/:/home/yocto/ws/layers - ./poky/:/home/yocto/ws/poky - ./scripts/:/home/yocto/ws/scripts entrypoint: /home/yocto/ws/scripts/docker-entrypoint.sh stdin_open: true # equivalent to -it tty: true # equivalent to -it restart: always