Skip to content

Commit 692fb52

Browse files
authored
Adding callout to both --volume and --mount (#382)
1 parent 78572c6 commit 692fb52

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

docs/ADVANCED.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,39 @@ When starting the docker container, the `default.yml` can be mounted in `/tmp/de
5151

5252
Environment variables specified at runtime will take precedence over anything defined in `default.yml`.
5353
```bash
54-
# Volume-mounting option
54+
# Volume-mounting option using --volumes/-v flag
5555
$ docker run -d -p 8000:8000 -e "SPLUNK_PASSWORD=<password>" \
5656
-e "SPLUNK_START_ARGS=--accept-license" \
57-
-v default.yml:/tmp/defaults/default.yml \
57+
-v "$(pwd)/default.yml:/tmp/defaults/default.yml" \
58+
splunk/splunk:latest
59+
60+
# Volume-mounting option using --mount flag
61+
$ docker run -d -p 8000:8000 -e "SPLUNK_PASSWORD=<password>" \
62+
-e "SPLUNK_START_ARGS=--accept-license" \
63+
--mount type=bind,source="$(pwd)"/default.yml,target=/tmp/defaults/default.yml
5864
splunk/splunk:latest
5965

6066
# URL option
61-
$ docker run -d -p 8000:8000 -v -e "SPLUNK_PASSWORD=<password>" \
67+
$ docker run -d -p 8000:8000 -e "SPLUNK_PASSWORD=<password>" \
6268
-e "SPLUNK_START_ARGS=--accept-license" \
6369
-e "SPLUNK_DEFAULTS_URL=http://company.net/path/to/default.yml" \
6470
splunk/splunk:latest
6571
```
6672

73+
Additionally, note that you do not need to supply the full `default.yml` if you only choose to modify a portion of how Splunk Enterprise is configured upon boot. For instance, if you wish to take advantage of the ability to write conf files through the `splunk.conf` key, the full `default.yml` passed in will simply look like the following:
74+
```
75+
splunk:
76+
conf:
77+
- key: indexes
78+
value:
79+
directory: /opt/splunk/etc/system/local
80+
content:
81+
test:
82+
homePath: $SPLUNK_DB/test/db
83+
coldPath: $SPLUNK_DB/test/colddb
84+
thawedPath: $SPLUNK_DB/test/thaweddb
85+
```
86+
6787
### Configuration specs for default.yml
6888

6989
#### Global variables

docs/advanced/APP_INSTALL.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ App installation can be done a variety of ways: either through a file/directory
1616
If you have a local directory that follows the proper Splunk apps model, you can mount this entire path to the container at runtime.
1717

1818
For instance, take the following app `splunk_app_example`:
19-
```
19+
```bash
2020
$ find . -type f
2121
./splunk_app_example/default/app.conf
2222
./splunk_app_example/metadata/default.meta
2323
```
2424

2525
We can bind-mount this upon container start and use it as a regular Splunk app:
26-
```
27-
$ docker run -it -v ./splunk_app_example:/opt/splunk/etc/apps/splunk_app_example/ --name so1 --hostname so1 -p 8000:8000 -e "SPLUNK_PASSWORD=<password>" -e "SPLUNK_START_ARGS=--accept-license" -it splunk/splunk:latest
26+
```bash
27+
# Volume-mounting option using --volumes/-v flag
28+
$ docker run -it -v "$(pwd)/splunk_app_example:/opt/splunk/etc/apps/splunk_app_example/" --name so1 --hostname so1 -p 8000:8000 -e "SPLUNK_PASSWORD=<password>" -e "SPLUNK_START_ARGS=--accept-license" -it splunk/splunk:latest
29+
30+
# Volume-mounting option using --mount flag
31+
$ docker run -it --mount type=bind,source="$(pwd)"/splunk_app_example,target=/opt/splunk/etc/apps/splunk_app_example/ --name so1 --hostname so1 -p 8000:8000 -e "SPLUNK_PASSWORD=<password>" -e "SPLUNK_START_ARGS=--accept-license" -it splunk/splunk:latest
2832
```
2933

3034
You should be able to view the `splunk_app_example` in SplunkWeb after the container successfully finished provisioning.

0 commit comments

Comments
 (0)