How to switch off internet only in the Docker container

I want to test something is it possible to switch off internet connection in the storj docker container in the container itself ?

Its possible for linux and pretty easy for windows. But why would you?

Can you tell me how it works ?

it could be useful for migrating data.