I am trying to setup an integration testing environment for Docker. We need to restore a bacpac to our mssql-server-linux:latest
image so we can run tests based on the dataset.
My compose file looks like:
version: '3'
services:
projectweb:
image: projectweb
build:
context: .
dockerfile: Project\Dockerfile
depends_on:
- db
db:
image: "microsoft/mssql-server-linux"
environment:
SA_PASSWORD: "MyVerySecurePassword"
ACCEPT_EULA: "Y"
volumes:
- ./database:/tmp
I don't need the changes to the database to be persisted past the life of the container. I just need to script getting the data into it. I don't have a lot of experience with docker or SQL Server for Linux. I assume I need to wait for the container to be initilizsed and DB setup and started, then execute a script that reads the database bacpac from tmp folder. As far as I understand I should use sqlpackage but this doesn't appear to be in the container? Do I need another container with this SSDT/sqlpackage in it? Can I install splpackage into the container?
What is the best way to do import bacpac data?
This has now been resolved. Microsoft have a proper sql package for Linux. This can be installed into a custom image. https://learn.microsoft.com/en-us/sql/tools/sqlpackage?view=sql-server-2017
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With