This one turned out to be harder and simpler than I originally thought it would be. Let me explain.
I was thinking this would be pretty fast since there are literally tons of dockerfile examples out there. But many I tried just didn’t work for a variety of issues. This is the harder part. The simpler part was how uncomplicated the dockerfile that works is.
What eventually led me to getting this to work was to watch an excellent video by Eric Kang (reference #7). He is a Microsoft Senior Program Manager. In this video (first 10 minutes or so), he goes through some very basic and helpful steps I was not aware of. However, the light didn’t really come on until I realized how the environment variables (3) were being set in the container. Kinda a duh moment I will admit 🙂 Adding the ‘=’ for each environment variable (i.e. ENV ACCEPT_EULA=Y) was the secret. In Mr. Kang’s docker file (and others) samples, it was listed as ENV ACCEPT_EULA Y. The clue was that my automated tests couldn’t log in even though I had specified the correct password. Adding the ‘=’ sign did the trick.
The process I used is:
- Create a docker file similar to Mr. Kang’s
- Update my existing docker-compose.yml file
- Clean out all my previous docker containers and images
- Run docker-compose up -d
- Confirm the containers were up and running
- Run my integration tests
Next, I will create a test set of tables in my production SQL Server instance and spin up a Dynamo Db instance and run these in the AWS code pipeline so that if any tests fail, the deploy will be stopped.