Building distroless tiny server Docker images
In previous chapters, our server Docker images were roughly around 1.5 GB. This is pretty big and not ideal when we want to distribute our Rust images on servers or to other developers. Note that there is a shell that we can access in the Docker container when the image is running. This is useful in development but not great in production because if anyone manages to gain access to the Docker container, they will be able to look around and run commands in the Docker container. If the permissions on the server are not locked down, the hacker could even start running commands on the cluster that you have. I have seen cryptojacking happen through this method, where a hacker spun up a load of mining Pods at the expense of the owner of the AWS account.
We are going to solve these problems by using distroless images. These distroless images are tiny in size and do not have shells. So, if someone manages to gain access to our server, they will...