https://github.com/ikemtz/sql_dacpac
Based on the latest SQL server docker image, this image has the tools necessary to deploy your DacPac files to your SQL docker containers. This image is intended to be used temporarily as part of your build process. Please review the example below.
https://github.com/ikemtz/sql_dacpac
dacpac dacpac-packages docker mssql
Last synced: about 2 months ago
JSON representation
Based on the latest SQL server docker image, this image has the tools necessary to deploy your DacPac files to your SQL docker containers. This image is intended to be used temporarily as part of your build process. Please review the example below.
- Host: GitHub
- URL: https://github.com/ikemtz/sql_dacpac
- Owner: ikemtz
- License: mit
- Created: 2019-05-22T15:23:39.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-08T13:08:13.000Z (8 months ago)
- Last Synced: 2025-02-25T21:11:21.569Z (2 months ago)
- Topics: dacpac, dacpac-packages, docker, mssql
- Language: Dockerfile
- Homepage: https://hub.docker.com/repository/docker/ikemtz/sql_dacpac/general
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://hub.docker.com/repository/docker/ikemtz/sql_dacpac)
# SQL Dacpac
Based on the latest SQL server docker image, this image has the tools necessary to deploy your DacPac files to your SQL docker containers. This image is intended to be used temporarily as part of your build process. Please review the example below.
## Example Usage
```
FROM ikemtz/sql_dacpac:latest as sql-temp
ENV SA_PASSWORD=YOUR_DESIRED_PASSWORD \
ACCEPT_EULA=Y \
NEW_DB_NAME=YOUR_NEW_DATABASE_NAMECOPY *.dacpac /dacpac/
RUN sqlservr & sleep 20 \
&& sqlpackage /Action:Publish \
/SourceTrustServerCertificate:true \
/TargetTrustServerCertificate:true \
/TargetServerName:localhost \
/TargetUser:sa \
/TargetPassword:$SA_PASSWORD \
/SourceFile:/dacpac/db.dacpac \
/TargetDatabaseName:$NEW_DB_NAME \
/p:BlockOnPossibleDataLoss=false \
&& sleep 20 \
&& pkill sqlservr && sleep 10FROM mcr.microsoft.com/mssql/server:2019-latest
LABEL author="@IkeMtz"
ENV SA_PASSWORD=YOUR_DESIRED_PASSWORD \
ACCEPT_EULA=Y \
NEW_DB_NAME=YOUR_NEW_DATABASE_NAME
EXPOSE 1433
COPY --from=sql-temp /var/opt/mssql/data/$NEW_DB_NAME*.mdf /var/opt/mssql/data/
COPY --from=sql-temp /var/opt/mssql/data/$NEW_DB_NAME*.ldf /var/opt/mssql/data/```