No /dev/ttyS0 in container

I want to use UART on Rpi3, but in a container, there is no /dev/ttyS0 or /dev/ttyAMA0. After connecting to host os, there are all these devices, but in a container there is only /dev/tty file. Am I missing something? I tried it by running “ls /dev/tty*” command. Problem is in single container setup and also in multi container setup. Here is used docker compose:

version: ‘2’

services:
main:
build: ./main
privileged: true
devices:
- “/dev/ttyS0:/dev/ttyS0”
wifi:
image: “jasonhillier/rpi3-wifiap”
privileged: true
network_mode: “host”
environment:
- SSID = Test
- PASSWORD = test

Hi,

Have you added the following to your docker-compose file too?

    cap_add:
      - SYS_RAWIO

More detail here https://www.balena.io/docs/learn/develop/hardware/