Let's talk about an advanced setup for running Shopware 6.
The easy first run is perfect to immediately start Shopware, but does not persist any data or allows you to reuse that Shopware 6 instance again after restarting your host.
Use this content and place it in a file called docker-compose.yml.
It will use internal Docker volumes to persist your database and everything that is stored within your DocRoot, such as "media" files, "download" files and more.
Now start dockware with this command from the terminal with the directory that contains your yaml file as working directory:
docker compose up -d
The option "-d" means "detached" and makes sure your container isn't quit when you close your terminal. If you still want to see the output of dockware, use this command.ON HOST
docker logs -f shopware