How to create a network using a command line script?

Since you’re already using WP-CLI, I recommend you to use the wp core multisite-install command to set up your network installation.

When you check out the documentation you’ll see that it’s pretty straightforward. Here’s the example from the docs:

$ wp core multisite-install --title="Welcome to the WordPress" \
> --admin_user="admin" --admin_password="password" \
> --admin_email="[email protected]"
Single site database tables already present.
Set up multisite database tables.
Added multisite constants to wp-config.php.
Success: Network installed. Don't forget to set up rewrite rules.

You can perfectly use this command to set everything up in your Docker environment.