How to populate docker volumes in a build step to be used by a different container
docker-compose is just a glorified wrapper around docker which gives you a nice textual representation of all the options you would regularly give to docker build or docker run. Plus, of course, it bundles several docker images/containers together. That said, it has no provisions to run anything else than you would get by calling docker.

I don't see how you would use docker-compose build to populate a volume. Volumes are, by definition, not living inside docker images/containers, but outside (on the host system). docker build never writes to the host system, and you cannot mount volumes during docker build. docker-compose build basically only runs docker build for you, and also has no way to run or write anything on the host.

So, no, docker-compose build will not be able to create the static files.

You could make your compose file so that it runs your generator (inside a docker container, writing to a named volume), and runs your server (nginx or whatever) in another container, mounting the same named volume (this would be your case 2, I believe). Then, with docker-compose up, it would fire up both those containers. The first one would populate your static files; the second would serve. The first would hang around and do nothing afterwards, which you could just ignore, but which would certainly be ugly. Unfortunately, you cannot use something like docker-compose up --rm to automatically the unneccessary jekyll container.

So, your best bet is to start the jekyll container yourself (docker run --rm jekyll:xyz -v ...:...), the --rm will remove the container after it is finished. Then docker-compose up with the actual server(s).