Skip to content

Commit 9598524

Browse files
Add line breaks to code snippets (docker#5166)
1 parent 7ada9fd commit 9598524

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

engine/security/https.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ In the daemon mode, it will only allow connections from clients
1818
authenticated by a certificate signed by that CA. In the client mode,
1919
it will only connect to servers with a certificate signed by that CA.
2020

21-
> **Warning**:
21+
> Advanced topic
22+
>
2223
> Using TLS and managing a CA is an advanced topic. Please familiarize yourself
2324
> with OpenSSL, x509 and TLS before using it in production.
24-
{:.warning}
25+
{:.important}
2526

26-
> **Warning**:
27+
> Only works on Linux
28+
>
2729
> These TLS commands will only generate a working set of certificates on Linux.
2830
> macOS comes with a version of OpenSSL that is incompatible with the
2931
> certificates that Docker requires.
30-
{:.warning}
32+
{:.important}
3133

3234
## Create a CA, server and client keys with OpenSSL
3335

@@ -43,6 +45,7 @@ First, on the **Docker daemon's host machine**, generate CA private and public k
4345
e is 65537 (0x10001)
4446
Enter pass phrase for ca-key.pem:
4547
Verifying - Enter pass phrase for ca-key.pem:
48+
4649
$ openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem
4750
Enter pass phrase for ca-key.pem:
4851
You are about to be asked to enter information that will be incorporated
@@ -72,6 +75,7 @@ name) matches the hostname you will use to connect to Docker:
7275
.....................................................................++
7376
.................................................................................................++
7477
e is 65537 (0x10001)
78+
7579
$ openssl req -subj "/CN=$HOST" -sha256 -new -key server-key.pem -out server.csr
7680

7781
Next, we're going to sign the public key with our CA:
@@ -113,6 +117,7 @@ request:
113117
.........................................................++
114118
................++
115119
e is 65537 (0x10001)
120+
116121
$ openssl req -subj '/CN=client' -new -key key.pem -out client.csr
117122

118123
To make the key suitable for client authentication, create an extensions
@@ -156,7 +161,9 @@ providing a certificate trusted by our CA:
156161
To be able to connect to Docker and validate its certificate, you now
157162
need to provide your client keys, certificates and trusted CA:
158163

159-
> **Note**: This step should be run on your Docker client machine. As such, you
164+
> Run it on the client machine
165+
>
166+
> This step should be run on your Docker client machine. As such, you
160167
> need to copy your CA certificate, your server certificate, and your client
161168
> certificate to that machine.
162169
@@ -186,6 +193,7 @@ the files to the `.docker` directory in your home directory -- and set the
186193

187194
$ mkdir -pv ~/.docker
188195
$ cp -v {ca,cert,key}.pem ~/.docker
196+
189197
$ export DOCKER_HOST=tcp://$HOST:2376 DOCKER_TLS_VERIFY=1
190198

191199
Docker will now connect securely by default:

0 commit comments

Comments
 (0)