The main drawback of building microservices inside an image is that all of the sources and build artifacts will be available for anyone who has access to a Docker image. If you want to remove sources and other building artifacts, you can use one of two approaches.
- The first approach is to build all sources using a Docker image with the Rust compiler, providing access to sources through a linked virtual volume. In Docker, you can map any local folder to a volume inside a container using the -v argument of the docker run command. The disadvantage of this approach is that Docker uses another ID inside the container that you have in your local session. It can create files you can't delete without changing the ...