After instal Docker run following commands (depends on your main OS, maybe you need add "sudo" on begin for each command):
// install SQL Server
docker pull mcr.microsoft.com/mssql/server:2017-latest
// run container
docker run --name sqlserver --hostname sqlserver -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourPasswordHere" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest
// run container with autorun on restart (add --restart always)
docker run -- restart always --name sqlserver --hostname sqlserver -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourPasswordHere" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest
// list services
docker ps -a
// open bash terminal inside into container
docker exec -it sqlserver "bash"
// run sqlcmd tool
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "YourPasswordHere"
// stop container
docker stop sqlserver
// remove
docker rm sqlserver
Nenhum comentário:
Postar um comentário