Accessing external reader(smart card readers, nfc reader,etc) devices inside a docker container

1.5k views Asked by At

I am trying to make a application that uses a card reader and want to dockerise that solution. As of now I have dockerised the application (Linux container using WSL on windows (docker desktop))but catch is I cant seem to access the reader inside the container.

To check access I am using a simple lsusb command after running docker exec -it <container name> /bin/bash.

I have referred following approach: Docker - a way to give access to a host USB or serial device?

Also I am using Pyscard python library to access the reader for the application.

1

There are 1 answers

0
Ludovic Rousseau On

One way to solve your problem is to make the socket /run/pcscd/pcscd.comm available from inside the docker container.

You can inspire from the solution with flatpak I described in Accessing smart cards from inside a flatpak sandbox.