Skip to content

Commit 533b00d

Browse files
committed
Fix Markdown formatting and missing prompt in service create
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent b16bfba commit 533b00d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docs/reference/commandline/service_create.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,16 @@ access to the network.
370370
When you create a service and pass the --network flag to attach the service to
371371
the overlay network:
372372

373+
```bash
373374
$ docker service create \
374375
--replicas 3 \
375376
--network my-network \
376377
--name my-web \
377378
nginx
378379

379380
716thylsndqma81j6kkkb5aus
381+
```
382+
380383
The swarm extends my-network to each node running the service.
381384

382385
Containers on the same network can access each other using
@@ -388,13 +391,13 @@ You can publish service ports to make them available externally to the swarm
388391
using the `--publish` flag:
389392

390393
```bash
391-
docker service create --publish <TARGET-PORT>:<SERVICE-PORT> nginx
394+
$ docker service create --publish <TARGET-PORT>:<SERVICE-PORT> nginx
392395
```
393396

394397
For example:
395398

396399
```bash
397-
docker service create --name my_web --replicas 3 --publish 8080:80 nginx
400+
$ docker service create --name my_web --replicas 3 --publish 8080:80 nginx
398401
```
399402

400403
When you publish a service port, the swarm routing mesh makes the service

0 commit comments

Comments
 (0)