Bug fixing with Docker

The process is much simpler with Docker. To replicate the UAT environment locally, I just need to run containers from the same images that are running in UAT. There will be a Docker Compose or stack file describing the whole solution which is versioned, so by deploying version 1.1, I get the exact same environment as UAT without having to build from source.

I should be able to replicate the issue at this point and confirm whether it's a coding issue or something to do with data or the environment. If it's a configuration issue, then I should see the same problem as UAT, and I could test the fix with an updated Compose file. If it's a coding issue, then I need to dig into the code.

At this point, I can clone the source from the version 1.1 tag and build the Docker images in debug mode, but I don't spend time doing that until I'm pretty sure this is a problem in the app. If I'm using multi-stage builds with all versions pinned in the Dockerfile, the local build will produce an identical image to the one running in UAT, but with the extra artifacts for debugging.

Now, I can find the problem, write a test, and fix the bug. When the new integration test passes, it's executing against the same Dockerized solution I'll be deploying in UAT, so I can be very confident that the bug is fixed.

If there's no CI configured for the 1.1 branch, then setting it up should be straightforward because the build task will just need to run the docker image build or docker-compose build commands. If I want fast feedback, I can even push the locally built image to the registry and deploy a new UAT environment to verify the fix while the CI setup is being configured. That new environment will just be a different stack on the test cluster, so I don't need to commission any more infrastructure for the deployment.

The workflow with Docker is much cleaner and faster, but more importantly, there is far less risk. When you replicate the issue locally, you are using the exact same application components running on the exact same platform as the UAT environment. When you test your fix, you know it will work in UAT because you'll be deploying the same new artifacts.

The time you invest in Dockerizing your application will be repaid many times over by the time saved in supporting multiple versions of the app.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.76.72