This is a lightweight, minimal setup that has Composer and WP_CLI support.
You only need Docker and docker compose plugin or older version of docker-compose utility.
docker compose up
docker compose run --rm composer composer <command>
In similar manner, run WP_CLI container:
docker compose run --rm wp_cli wp <command>
visit local site on http://localhost:8888