I'm having memory issues on my machine because I need to run many instances of a heavy container.
I was wondering is it possible to pre-build a container, and inject it into other containers on different ports, as needed?
You can. In fact that's how Docker images are meant to be distributed.
After you build and tag the image, use docker push to push to a remote registry. You can then download the image from that registry.
There are many options for private registries, the best-known being:
Or if you don't mind your image being public, just push to the official Docker registry.