Not sure how hard this would be, instead of running "flake8 blabla", one can run "docker run bla bla". Or even docker exec bla bla if you have the container already running. And by "you run" I mean vscode does that for you, via an extension.
That could be an idea, so in practice, you move the responsibility to the editor which I think is actually the correct thing to do. Regarding VSCode specifically I don't know, as I don't use it.
This is almost exactly how Pycharm works with testing/auto complete/coverage.
It has support to use a a particular interpreter, specific virtual env, or it lets you say “my interpreter is inside this docker container”, which is even allowed to be on a remote host (although I’ve always used docker running locally).