I don't think that equating all open source work with volunteering makes sense.
Volunteering is defined by its charitable purpose for a public good, not by the specific skill used.
Let me try an analogy:
A chef who cooks a free meal for a homeless shelter is volunteering. That same chef publishing a recipe online or making a cooking tutorial is sharing knowledge, not volunteering. The act of 'cooking' or 'publishing' is neutral. It becomes volunteering only when the primary, direct, and organised purpose is to serve a charitable cause without expectation of personal gain.
Disclaimer: I have been consistently doing a lot of open source in the last 10 years. I would consider none of that as volunteering.
But the German word for it is "gemeinnützig" which loosely translates to "useful for the commons".
So also things like helping kids with their homework or giving people courses in your hackerspace, repaircafes, reading with others can fall into that.
So while maybe not all software that is open source also is automatically useful for the commons as it is now the definition is way too narrow. If you write software that helps one of the existing recognized causes it is openns source. If you write an open source photoshop or spend days working on software that keeps the world running you don't. But we need the latter people and supporting the former people makes the world a better place.