It's essentially building the entire stack (selecting a base OS, installing applications, etc) in the image. A couple of examples are:
A Docker image is the blueprint of Docker containers that contains the application and everything you need to run the application. In this tutorial, we will explain what Dockerfile is, how to create one and how to build a Docker image with Dockerfile.
linuxize.com
In this article, you will learn to build Docker image from scratch, deploy and run your application as a Docker container using Dockerfile
devopscube.com
You can also have a source tarball you can copy into the image with the COPY command then extract it with a CMD. Be prepared for a frustrating experience, though. Some software becomes a real pain, especially if it needs access outside of a container, such as a USB device.