1- ``` {highlight} sh
2- ```
3-
41(cratedb-docker)=
52
63# Run CrateDB on Docker
@@ -35,7 +32,7 @@ with no vote.
3532
3633To create the [ user-defined network] , run the command:
3734
38- ```
35+ ``` shell
3936sh$ docker network create crate
4037```
4138
@@ -120,7 +117,7 @@ f79116373877 crate "/docker-entrypoin..." 16 seconds ago
120117
121118You can have a look at the container's logs in tail mode like this:
122119
123- ``` text
120+ ``` shell
124121sh$ docker logs -f crate01
125122```
126123
@@ -139,7 +136,7 @@ page that lists a single node.
139136
140137Now add the second node, ` crate02 ` , to the cluster:
141138
142- ```
139+ ``` shell
143140sh$ docker run --rm -d \
144141 --name=crate02 \
145142 --net=crate \
@@ -169,7 +166,7 @@ should see two nodes.
169166
170167You can now add ` crate03 ` like this:
171168
172- ```
169+ ``` shell
173170sh$ docker run --rm -d \
174171 --name=crate03 \
175172 --net=crate -p 4203:4200 \
@@ -213,7 +210,7 @@ If the limit cannot be adjusted on the host system, the memory map limit check
213210can be bypassed by passing the ` -Cnode.store.allow_mmap=false ` option to
214211the ` crate ` command:
215212
216- ```
213+ ``` shell
217214sh$ docker run -d --name=crate01 \
218215 --net=crate -p 4201:4200 --env CRATE_HEAP_SIZE=1g \
219216 crate -Cnetwork.host=_site_ \
@@ -227,7 +224,7 @@ This will result in degraded performance.
227224You can also start a single node without any {ref}`bootstrap checks
228225<bootstrap-checks >` by passing the ` -Cdiscovery.type=single-node` option:
229226
230- ```
227+ ``` shell
231228sh$ docker run -d --name=crate01 \
232229 --net=crate -p 4201:4200 \
233230 --env CRATE_HEAP_SIZE=1g \
@@ -255,7 +252,7 @@ If you wanted to run `crash` inside a user-defined network called `crate`
255252and connect to three hosts named ` crate01 ` , ` crate02 ` , and ` crate03 `
256253(i.e. the example covered in the [ Creating a Cluster] section) you could run:
257254
258- ```
255+ ``` shell
259256$ docker run --rm -ti \
260257 --net=crate crate \
261258 crash --hosts crate01 crate02 crate03
@@ -370,7 +367,7 @@ per host machine.
370367If you are running one container per machine, you can map the container ports
371368to the host ports so that the host acts like a native installation. For example :
372369
373- ` ` `
370+ ` ` ` shell
374371$ docker run -d -p 4200:4200 -p 4300:4300 -p 5432:5432 --env CRATE_HEAP_SIZE=1g crate \
375372 crate -Cnetwork.host=_site_
376373` ` `
@@ -382,7 +379,7 @@ and go, and any data inside them is lost when the container is removed. For
382379this reason, you should mount a persistent `data` directory on your host
383380machine to the `/data` directory inside the container :
384381
385- ` ` `
382+ ` ` ` shell
386383$ docker run -d -v /srv/crate/data:/data --env CRATE_HEAP_SIZE=1g crate \
387384 crate -Cnetwork.host=_site_
388385` ` `
@@ -401,7 +398,7 @@ removed.
401398
402399Here is an example of how you could mount the `crate.yml` config file :
403400
404- ` ` `
401+ ` ` ` shell
405402$ docker run -d \
406403 -v /srv/crate/config/crate.yml:/crate/config/crate.yml \
407404 --env CRATE_HEAP_SIZE=1g crate \
@@ -470,7 +467,7 @@ If you want the container to use a maximum of 1.5 CPUs, a maximum of 2 GB
470467memory, with a heap size of 1 GB, you could configure everything at once. For
471468example :
472469
473- ` ` `
470+ ` ` ` shell
474471$ docker run -d \
475472 --cpus 1.5 \
476473 --memory 1g \
0 commit comments