{"id":18244399,"url":"https://github.com/dataplat/docker","last_synced_at":"2025-04-04T13:31:27.873Z","repository":{"id":41851814,"uuid":"430147521","full_name":"dataplat/docker","owner":"dataplat","description":"The code that's used to create the dbatools SQL Server images on Docker Hub.","archived":false,"fork":false,"pushed_at":"2022-12-24T00:37:32.000Z","size":7024,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-20T13:41:49.386Z","etag":null,"topics":["docker","powershell","sqlserver"],"latest_commit_sha":null,"homepage":"https://dbatools.io/docker","language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dataplat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-20T16:04:57.000Z","updated_at":"2023-03-21T05:38:27.000Z","dependencies_parsed_at":"2023-01-30T20:00:47.671Z","dependency_job_id":null,"html_url":"https://github.com/dataplat/docker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataplat%2Fdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataplat%2Fdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataplat%2Fdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataplat%2Fdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dataplat","download_url":"https://codeload.github.com/dataplat/docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247185010,"owners_count":20897875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","powershell","sqlserver"],"created_at":"2024-11-05T09:16:33.174Z","updated_at":"2025-04-04T13:31:27.585Z","avatar_url":"https://github.com/dataplat.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker\n\nThis repo holds the Docker compose code that was used to create the images featured on [dbatools.io/docker](https://dbatools.io/docker). \n\nIt's intended not only to help test out dbatools, but to also explore the creation of SQL Server-based containers for your own environment. The compose code is heavily commented and the repo is a work in progress as I'm also learning. Suggestions for improvement are welcome!\n\nTo read about the things I learned while creating these containers, along with tips and tricks, [visit the wiki](https://github.com/potatoqualitee/docker/wiki).\n\n## Get started\n\nTo get started and see the containers built in real-time, first clone this repo, then build the base images and containers using `docker-compose`. You can also use `docker compose` without the dash if you use Docker Desktop, as explained on '[Difference between \"docker compose\" and \"docker-compose\"](https://stackoverflow.com/questions/66514436/difference-between-docker-compose-and-docker-compose).'\n\n```shell\ngit clone https://www.github.com/potatoqualitee/docker\ncd docker\\sqlinstance\ndocker-compose up -d\n```\n\nThis will pull the SQL Server images from Microsoft's repo, then add a bunch of test objects (databases, logins, jobs, etc) using bash and sql files in this repo, and then make them available for you to connect to on the default port 1433 for the first instance and port 14333 for the second instance.\n\nNote:  If you're using ARM architecture (Apple M1 or Raspberry Pi), none of the High Availability commands will work, as ARM is only supported by SQL Edge, which is limited.\n\n## Time to play 🎉\n\nNow we are setup to test commands against your two containers! You can login via [SQL Server Management Studio](https://sqlps.io/dl) or [Azure Data Studio](https://docs.microsoft.com/en-us/sql/azure-data-studio/download?view=sql-server-2017) if you’d like to take a look first. The server name is `localhost` for the first instance and `localhost,14333` for the second instance), the username is `sqladmin` and the password is `dbatools.IO`\n\n![image](https://user-images.githubusercontent.com/8278033/142866226-35a5113b-4297-4e66-9c32-4d02e2f0a0d0.png)\n\nNote that dbatools supports both using commas and colons to designate a port. When you use a comma, however, you must also use quotes: `'localhost,14333'`. When using dbatools, we recommend just using `localhost:14333`.\n\n```powershell\n$cred = Get-Credential sqladmin\nConnect-DbaInstance -SqlInstance localhost, localhost:14333 -SqlCredential $cred\n```\nIf you'd like to test more commands, check out [dbatools and docker (updated!)](https://dbatools.io/docker)\n\nTo stop the containers, run the following command in the docker\\sqlinstance directory:\n\n```shell\ndocker compose down\n```\n\nAnd if you'd like to remove the persisent volume it created for the containers to share data, use `--volumes`\n\n```shell\ndocker compose down --volumes\n```\n\n## Remove everything\n\nIf you want to uninstall, or start from a \"clean\" installation, docker compose can remove all the containers and volumes in one command.\n\n```shell\ndocker builder prune -a -f\ndocker compose down --remove-orphans --volumes\ndocker rmi $(docker images -q \"dbatools\\/*\")\n```\n\n## Resources\n\nSome of the best resources I found included:\n\n* [Top 20 Dockerfile best practices (sysdig)](https://sysdig.com/blog/Dockerfile-best-practices)\n* [Multi-arch build and images, the simple way](https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/)\n\nRepos\n* [dbafromthecold/SqlServerAndContainersGuide](https://github.com/dbafromthecold/SqlServerAndContainersGuide/tree/master/Code/6.DockerCompose/Advanced)\n* [twright-msft/mssql-node-docker-demo-app](https://github.com/twright-msft/mssql-node-docker-demo-app)\n* [jessfraz/Dockerfiles](https://github.com/jessfraz/Dockerfiles)\n* [edemaine/kadira-compose](https://github.com/edemaine/kadira-compose)\n* [vicrem/mssql](https://github.com/vicrem/mssql/blob/master/docker-compose.yml)\n* [microsoft/go-sqlcmd](https://github.com/microsoft/go-sqlcmd/)\n* [microsoft/mssql-docker](https://github.com/microsoft/mssql-docker/tree/master/linux/preview/examples/mssql-customize)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataplat%2Fdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdataplat%2Fdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataplat%2Fdocker/lists"}