Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ormico/sqlpackage-docker
SqlPackage in a Docker image
https://github.com/ormico/sqlpackage-docker
docker-image sqlserver
Last synced: 3 months ago
JSON representation
SqlPackage in a Docker image
- Host: GitHub
- URL: https://github.com/ormico/sqlpackage-docker
- Owner: ormico
- License: mit
- Created: 2020-09-12T03:50:13.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-19T05:21:12.000Z (8 months ago)
- Last Synced: 2024-06-22T20:24:37.063Z (5 months ago)
- Topics: docker-image, sqlserver
- Language: Dockerfile
- Homepage:
- Size: 35.2 KB
- Stars: 3
- Watchers: 5
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - ormico/sqlpackage-docker - SqlPackage in a Docker image (Dockerfile)
README
# SqlPackage in a Docker image
[![Docker Image CI](https://github.com/ormico/sqlpackage-docker/actions/workflows/docker-image.yml/badge.svg)](https://github.com/ormico/sqlpackage-docker/actions/workflows/docker-image.yml)[SqlPackage](https://docs.microsoft.com/en-us/sql/tools/sqlpackage?view=sql-server-ver15) is a Microsoft tool for importing and exporting bacpac and dacpac files from SQL Server.
This Docker image contains sqlpackage and is designed for when you want to run SqlPackage without installing it locally.
This image also contains `sqlcmd`. This makes this image very useful for running basic SQL Server tasks.
# Docker Hub
[ormico/sqlpackage](https://hub.docker.com/r/ormico/sqlpackage)
This image is updated regularly on Docker Hub to contain the latest changes from SqlPackage and the base image.
# GitHub
[https://github.com/ormico/sqlpackage-docker](https://github.com/ormico/sqlpackage-docker)
# How to use
Examples are in Powershell but can be easily converted to bash.
## SqlPackage
The following example downloads a bacpac of database exampledb1 to a folder named download.Start by creating a `$path` variable which is an absolute path to a folder named `download`.
Then execute `sqlpackage` by running the docker container and specifying sqlpackage and the parameters. Progress will be printed to the console and the file will be saved to the `download` subfolder.
```
$path = join-path (pwd) '/download'
docker container run -ti --rm -v ${path}:/download ormico/sqlpackage sqlpackage /a:export /scs:"Server=my-example-azure-server.database.windows.net;Database=exampledb1;User Id=myadmin;Password=Password1@;" /tf:/download/exampledb1.bacpac
```# Known Issues
* Base image is the MS SQL Server 2019 image. I don't use SQL Server but it was the only base image I could find that would successfully run SqlPackage. This does cause a message to print with SQL Server information when the container starts. A future version may remove SQL Server by changing the base image again.
# Additional Resources
* [https://github.com/microsoft/mssql-docker](https://github.com/microsoft/mssql-docker)
* [Linux Microsoft ODBC Driver for SQL Server](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#ubuntu17)