I haven’t done it myself, and it’s not clear it would work as a Docker service. According to https://github.com/SeleniumHQ/docker-selenium, they recommend a
docker run param to configure
/dev/shm to work around issues in Chrome (#519952) and Firefox (#1338771). We don’t support configuring docker run flags, however, so these issues might prevent selenium from running successfully.
If you do try it out, you can check out our Docker docs for more information on how to get started.