Firefox does not obey the HTTP_PROXY/http_proxy environment variables on Linux without additional plugins. There's no way to explicitly configure Firefox to use a proxy via the command-line, so workarounds are needed.
My usecase is setting up a throwaway Firefox instance in a container using an SSH SOCKS proxy for interactive browsing of restricted web interfaces.
To do the setup, create a new profile via:
mkdir /tmp/firefox_profile
echo 'user_pref("network.proxy.socks", "host.docker.internal");' >> /tmp/firefox_profile/prefs.js
echo 'user_pref("network.proxy.socks_port", 9000);' >> /tmp/firefox_profile/prefs.js
echo 'user_pref("network.proxy.type", 1);' >> /tmp/firefox_profile/prefs.js
Where host.docker.internal is the proxy hostname and 9000 is the port. For a http or https proxy, change socks and socks_port to http and http_port. network.proxy.type does not need to be changed, it simply instructs Firefox to use a manually defined proxy.
And then invoke Firefox using firefox --profile /tmp/firefox_profile. Firefox starts up, loads the existing proxy configuration and writes the rest of Firefox's profile configuration to the same directory.