Also volume in your $COMPOSER_HOME or $HOME/.config/composer directory for added speed, and to include any github auth you have set up on your host system.
It's all documented in the docker hub page for composer. hub.docker.com/_/composer
Including --user $(id -u):$(id -g) will keep files from being created as root in your home directory.
I'm a Software Engineer in Poland, working in my own small company. I built a lot of projects with PHP and other technologies connected with web development (JS, HTML5, Laravel, WordPress, CSS).
Also volume in your $COMPOSER_HOME or $HOME/.config/composer directory for added speed, and to include any github auth you have set up on your host system.
It's all documented in the docker hub page for composer. hub.docker.com/_/composer
Including --user $(id -u):$(id -g) will keep files from being created as root in your home directory.
Thanks for useful comment!