Doesn't a compiled executable do this?
Discussion
not all languages compile to static binaries.
many compiled binaries still rely on os-level packages.
Not really, it may pull in more dependencies and scatter config files on your file system. Many which won't necessarily be removed if you uninstall it.
Docker let's you mount a virtual FS for the container itself and pass through portions to your own FS (for data sharing for example).