I'm creating CI & CD pipeline for a new project. Since we are using Docker, here's my question: is it better to build and test in a Docker container, so the steps would be:
- Build Docker image
- Run app build in it
- Run app tests in it
- Push the Docker image
or outside Docker container and after CI passes, build the image:
- Build the project directly on CI server (outside container)
- Test it directly on CI server (outside container)
- Build Docker image & push