If I have a project setup with docker, using a .env that has the docker environment variables defined. How would I retrieve them while running cypress.io test spec?
Look at the official documentation https://docs.cypress.io/api/cypress-api/env You have to prefix your variables with CYPRESS_.
So for example if your .env file has CYPRESS_HOST=manz.com, you can access it in your tests as Cypress.env('HOST').