Files
azuredatastudio/extensions/resource-deployment/notebooks/sql2017-image-docker.ipynb
Alan Ren 586fe10525 resource deployment ext implementation -wip (#5508)
* resource types

* implement the dialog

* remove unused method

* fix issues

* formatting

* 5-17

* address comments and more tests
2019-05-17 20:24:02 -07:00

72 lines
2.3 KiB
Plaintext

{
"metadata": {
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python",
"version": "3.6.6",
"mimetype": "text/x-python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"pygments_lexer": "ipython3",
"nbconvert_exporter": "python",
"file_extension": ".py"
}
},
"nbformat_minor": 2,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": "First, pull the Microsoft SQL Server 2017 Image",
"metadata": {}
},
{
"cell_type": "code",
"source": "cmd = f'docker pull mcr.microsoft.com/mssql/server:2017-latest'\r\n!{cmd}",
"metadata": {},
"outputs": [],
"execution_count": 49
},
{
"cell_type": "markdown",
"source": "List all the containers",
"metadata": {}
},
{
"cell_type": "code",
"source": "cmd = f'docker ps -a'\r\n!{cmd}",
"metadata": {},
"outputs": [],
"execution_count": 50
},
{
"cell_type": "markdown",
"source": "Start a new container with SQL Server 2017",
"metadata": {}
},
{
"cell_type": "code",
"source": "import time\r\n\r\ncontainer_name = 'sql2017-' + time.strftime(\"%Y%m%d%H%M%S\", time.localtime())\r\nprint('New container name: ' + container_name)\r\n\r\nsql_port = 1433\r\nsa_password = \"<YourStrong!Passw0rd>\"\r\n\r\ncmd = f'docker run -e ACCEPT_EULA=Y -e \"SA_PASSWORD={sa_password}\" -p {sql_port}:{sql_port} --name {container_name} -d mcr.microsoft.com/mssql/server:2017-latest'\r\nprint(cmd)\r\n!{cmd}",
"metadata": {},
"outputs": [],
"execution_count": 51
},
{
"cell_type": "markdown",
"source": "List all the containers",
"metadata": {}
},
{
"cell_type": "code",
"source": "cmd = f'docker ps -a'\r\n!{cmd}",
"metadata": {},
"outputs": [],
"execution_count": 48
}
]
}