Skip to content

Commit 416dace

Browse files
authored
Merge pull request #7317 from dlumpp/patch-1
update '-hostname' to '--hostname'
2 parents fc10657 + 42e3e15 commit 416dace

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

docs/linux/quickstart-install-connect-docker.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Before starting the following steps, make sure that you've selected your preferr
102102
::: zone pivot="cs1-bash"
103103
```bash
104104
sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong@Passw0rd>" \
105-
-p 1433:1433 --name sql1 -hostname sql1 \
105+
-p 1433:1433 --name sql1 --hostname sql1 \
106106
-d \
107107
mcr.microsoft.com/mssql/server:2017-latest
108108
```
@@ -115,7 +115,7 @@ Before starting the following steps, make sure that you've selected your preferr
115115
116116
```PowerShell
117117
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong@Passw0rd>" `
118-
-p 1433:1433 --name sql1 -hostname sql1 `
118+
-p 1433:1433 --name sql1 --hostname sql1 `
119119
-d `
120120
mcr.microsoft.com/mssql/server:2017-latest
121121
```
@@ -124,7 +124,7 @@ Before starting the following steps, make sure that you've selected your preferr
124124
::: zone pivot="cs1-cmd"
125125
```cmd
126126
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong@Passw0rd>" `
127-
-p 1433:1433 --name sql1 -hostname sql1 `
127+
-p 1433:1433 --name sql1 --hostname sql1 `
128128
-d `
129129
mcr.microsoft.com/mssql/server:2017-latest
130130
```
@@ -143,7 +143,7 @@ Before starting the following steps, make sure that you've selected your preferr
143143
| **-e "SA_PASSWORD=\<YourStrong@Passw0rd\>"** | Specify your own strong password that is at least eight characters and meets the [SQL Server password requirements](../relational-databases/security/password-policy.md). Required setting for the SQL Server image. |
144144
| **-p 1433:1433** | Map a TCP port on the host environment (first value) with a TCP port in the container (second value). In this example, SQL Server is listening on TCP 1433 in the container and this is exposed to the port, 1433, on the host. |
145145
| **--name sql1** | Specify a custom name for the container rather than a randomly generated one. If you run more than one container, you cannot reuse this same name. |
146-
| **-hostname sql1** | Used to explicitly set the container hostname. If you don't specify the hostname, it defaults to the container ID, which is a randomly generated system GUID. |
146+
| **--hostname sql1** | Used to explicitly set the container hostname. If you don't specify the hostname, it defaults to the container ID, which is a randomly generated system GUID. |
147147
| **-d** | Run the container in the background (daemon) |
148148
| **mcr.microsoft.com/mssql/server:2017-latest** | The SQL Server 2017 Linux container image. |
149149

@@ -178,7 +178,7 @@ Before starting the following steps, make sure that you've selected your preferr
178178
docker exec -t sqlrhel cat /var/opt/mssql/log/errorlog | grep connection
179179
```
180180

181-
The `-hostname` parameter as discussed above, changes the internal name of the container to a custom value. This is the name you'll see returned in the following Transact-SQL query:
181+
The `--hostname` parameter as discussed above, changes the internal name of the container to a custom value. This is the name you'll see returned in the following Transact-SQL query:
182182

183183
```sql
184184
SELECT @@SERVERNAME,
@@ -187,7 +187,7 @@ SELECT @@SERVERNAME,
187187
SERVERPROPERTY('ServerName')
188188
```
189189

190-
Setting `-hostname` and `--name` to the same value is a good way to easily identify the target container.
190+
Setting `--hostname` and `--name` to the same value is a good way to easily identify the target container.
191191

192192
5. As a final step, change your SA password because the `SA_PASSWORD` is visible in `ps -eax` output and stored in the environment variable of the same name. See steps below.
193193

@@ -239,23 +239,23 @@ Before starting the following steps, make sure that you've selected your preferr
239239
::: zone pivot="cs1-bash"
240240
```bash
241241
sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong@Passw0rd>" \
242-
-p 1433:1433 --name sql1 -hostname sql1 \
242+
-p 1433:1433 --name sql1 --hostname sql1 \
243243
-d mcr.microsoft.com/mssql/server:2019-latest
244244
```
245245
::: zone-end
246246

247247
::: zone pivot="cs1-powershell"
248248
```PowerShell
249249
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong@Passw0rd>" `
250-
-p 1433:1433 --name sql1 -hostname sql1 `
250+
-p 1433:1433 --name sql1 --hostname sql1 `
251251
-d mcr.microsoft.com/mssql/server:2019-latest
252252
```
253253
::: zone-end
254254

255255
::: zone pivot="cs1-cmd"
256256
```cmd
257257
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong@Passw0rd>" `
258-
-p 1433:1433 --name sql1 -hostname sql1 `
258+
-p 1433:1433 --name sql1 --hostname sql1 `
259259
-d mcr.microsoft.com/mssql/server:2019-latest
260260
```
261261
::: zone-end
@@ -273,7 +273,7 @@ Before starting the following steps, make sure that you've selected your preferr
273273
| **-e "SA_PASSWORD=\<YourStrong@Passw0rd\>"** | Specify your own strong password that is at least eight characters and meets the [SQL Server password requirements](../relational-databases/security/password-policy.md). Required setting for the SQL Server image. |
274274
| **-p 1433:1433** | Map a TCP port on the host environment (first value) with a TCP port in the container (second value). In this example, SQL Server is listening on TCP 1433 in the container and this is exposed to the port, 1433, on the host. |
275275
| **--name sql1** | Specify a custom name for the container rather than a randomly generated one. If you run more than one container, you cannot reuse this same name. |
276-
| **-hostname sql1** | Used to explicitly set the container hostname. If you don't specify the hostname, it defaults to the container ID, which is a randomly generated system GUID. |
276+
| **--hostname sql1** | Used to explicitly set the container hostname. If you don't specify the hostname, it defaults to the container ID, which is a randomly generated system GUID. |
277277
| **mcr.microsoft.com/mssql/server:2019-latest** | The SQL Server 2019 Ubuntu Linux container image. |
278278

279279
3. To view your Docker containers, use the `docker ps` command.
@@ -302,7 +302,7 @@ Before starting the following steps, make sure that you've selected your preferr
302302

303303
4. If the **STATUS** column shows a status of **Up**, then SQL Server is running in the container and listening on the port specified in the **PORTS** column. If the **STATUS** column for your SQL Server container shows **Exited**, see [Troubleshooting SQL Server Docker containers](sql-server-linux-docker-container-troubleshooting.md).
304304

305-
The `-hostname` parameter as discussed above, changes the internal name of the container to a custom value. This changes the internal name of the container to a custom value. This is the name you'll see returned in the following Transact-SQL query:
305+
The `--hostname` parameter as discussed above, changes the internal name of the container to a custom value. This changes the internal name of the container to a custom value. This is the name you'll see returned in the following Transact-SQL query:
306306

307307
```sql
308308
SELECT @@SERVERNAME,

0 commit comments

Comments
 (0)