I have been using Docker for a lot of things. For example, docker-compose is extremely useful for quickly setting up a service-based development environment.
Recently, I had the need to run a command once in a Docker image and do something with the file output. For instance, this is quite useful when encapsulating a compilation step or when processing data from one file to another using a docker image, so a user only needs docker as a dependency and the image does the rest.
In this short post, we will explore using files in one-off docker commands with and without defining a custom Dockerfile.