Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecole committed Aug 2, 2024
1 parent 8c5af79 commit a3fe15f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _posts/2024-08-01-mssql-docker-containers-unhealthy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tags: docker mssql
meta-description: Microsoft made recent changes to their mssql/server:2022-latest and mssql/server:2019-latest Docker images, and it broke a lot of builds
---

Our team uses `docker-compose` to create temporary ephemeral database that we can use for integration tests and dispose. We were using the `mssql/server:2019-latest` image, but today the builds all randomly stopped working without a lot of info. The only detail I could find was a single line in the build log: `dependency failed to start: container <name> is unhealthy`. Everything worked fine locally. I found [this post](https://www.reddit.com/r/docker/comments/15m3eg5/docker_compose_nocache/) on Reddit which helped me realize my local system was pulling the old cached versions of the images. I performed the following two commands to recreate the error on my machine: `docker compose pull` then `docker compose up -d --force-recreate`.
Our team uses `docker-compose` to create temporary ephemeral databases that we can use for integration tests and then dispose. We were using the `mssql/server:2019-latest` image, but today the builds all randomly stopped working without much info. The only detail I could find was a single line in the build log: `dependency failed to start: container <name> is unhealthy`. Everything worked fine locally. I found [this post](https://www.reddit.com/r/docker/comments/15m3eg5/docker_compose_nocache/) on Reddit which helped me realize my local system was pulling the old cached versions of the images. I performed the following two commands to recreate the error on my machine: `docker compose pull` then `docker compose up -d --force-recreate`.

When I visited [Microsoft's Docker Repository](https://mcr.microsoft.com/en-us/product/mssql/server/tags) I saw that the image was modified today, so I figured something must have changed with the image. After more digging, I found the following [GitHub Issue](https://github.com/microsoft/mssql-docker/issues/892) that detailed the same issue for the `mssql/server:2022-latest` image. Here I saw that the latest packages are now including the new `mssql-tools18` package, which changes the directory of the ODBC tools we were using for a health check on our container. It seems like a lot of people copied and pasted the same health check from somewhere. The old broken health check: `test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$$SA_PASSWORD" -Q "SELECT 1" || exit 1` becomes the new working health check: `test: /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P "$${SA_PASSWORD}" -Q "SELECT 1" -b -o /dev/null` and now everything works again.

Expand Down

0 comments on commit a3fe15f

Please sign in to comment.