# \[Docker\] Set web.xml Parameters in Docker Compose

**URL:** <https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640>\
**Category:** Ignition\
**Tags:** docker\
**Created:** [April 19, 2023, 12:45pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640 "2023-04-19T12:45:28Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 19, 2023, 12:45pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/1 "2023-04-19T12:45:28Z")

</div>

I've started to play around with the Docker image for Ignition and I've a question: is there a way to set _web.xml_ parameters in Docker Compose? For example I need to set `<max-file-size>` to **41.697.640** , instead of the default value. I can't find any hint about that [here](https://docs.inductiveautomation.com/display/DOC81/Docker+Image#DockerImage-DeployinganEphemeralGatewayforTesting).  
Thank you.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 19, 2023, 3:14pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/2 "2023-04-19T15:14:14Z")

</div>

Look further down in the document; if you're on 8.1.10 or newer, you can pass any arbitrary gateway.xml parameters by prefixing the additional arguments with `gateway.`, as in:

```auto
docker run -d -p 9088:8088 \
   --name ignition-test \
   inductiveautomation/ignition:8.1.10 \
   -n docker-test \
   -a localhost \
   -h 9088 \
   -s 9043 \
   -- \
   gateway.resolveHostNames=true \
   gateway.useProxyForwardedHeader=true

```

So I'm pretty sure you would just pass `gateway.max-file-size=41697640` after the `--` to begin the arguments section.

@Kevin.Collins, how'd I do? 😄

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [April 19, 2023, 11:03pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/3 "2023-04-19T23:03:10Z")

</div>

Yup, you've got it! Here is the [specific docs link](https://docs.inductiveautomation.com/display/DOC81/Docker+Image#DockerImage-GatewayArguments) that mentions the gateway.xml arguments.

---

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 20, 2023, 6:01am UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/4 "2023-04-20T06:01:57Z")

</div>

Thank you both!

---

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 20, 2023, 6:43am UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/5 "2023-04-20T06:43:42Z")

</div>

I have another question.  
How should I hash my Gateway's admin password to store it in a file that is then passed as an environment variable ( **GATEWAY\_ADMIN\_PASSWORD\_FILE** )?

From the docs:

```auto
GATEWAY_ADMIN_PASSWORD 8.1.8+	Password value or salted hash to be used for initial gateway auto-commissioning.

```

I've tried using [GatewaySec](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.26/com/inductiveautomation/ignition/common/GatewaySec.html), but I cannot understand how the salted password should be input inside of the aforementioned file.

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [April 20, 2023, 1:25pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/6 "2023-04-20T13:25:32Z")

</div>

I've got a helper script for generating the proper format salted hash here:

> <https://gist.github.com/thirdgen88/c4257bd4c47b6cc7194d1f5e7cbd6444>

![generate-gw-password-hash-demo](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/751f71dfe92c48be17295419636cde4e072a97d5.gif)

---

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 20, 2023, 1:31pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/7 "2023-04-20T13:31:18Z")

</div>

Thank you. 🙂  
Then I just need to paste the string inside of the file and Ignition Gateway will automatically interpret it as a salted hash, right?

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [April 20, 2023, 1:31pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/8 "2023-04-20T13:31:56Z")

</div>

> [@Davide3i](#):
>
> Then I just need to paste the string inside of the file and Ignition Gateway will automatically interpret it as a salted hash, right?

Correct, it will recognize that specific format and store it directly.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 20, 2023, 1:46pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/9 "2023-04-20T13:46:02Z")

</div>

Ewww! You are using a timestamp to produce your salt. Consider reading eight bytes from `/dev/random` instead. Or mixing that in with the timestamp fed to `sha256sum`.

---

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 20, 2023, 2:11pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/10 "2023-04-20T14:11:54Z")

</div>

So you would simply do like this?

```auto
auth_salt="$(dd if=/dev/random bs=8 count=1)"

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 20, 2023, 2:15pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/11 "2023-04-20T14:15:25Z")

</div>

Not quite. You need hex characters, not the raw bytes, and with `/dev/random`, not `/dev/urandom`. That is the high-quality pool on older distros. (They are synonymous on current kernels, IIRC.)

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [April 20, 2023, 2:23pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/12 "2023-04-20T14:23:00Z")

</div>

I've updated the gist above with [revision 6](https://gist.github.com/thirdgen88/c4257bd4c47b6cc7194d1f5e7cbd6444/revisions#diff-32d91a1ca305ff1c7b6ca76f4b6fb8ee7eab03de2e93d4f93eaed36c09fda327). And yeah, okay to use `/dev/random` here which will block to ensure sufficient entropy (versus nonblocking urandom).

> Revision #6 now adds a new `-s` salt method flag with the following options:
> 
> - `timestamp` - the previous usage of timestamp as input to salt
> - `random` - now reads 8 hexadecimal characters from /dev/random as input to salt
> 
> The `random` option is the new default.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 20, 2023, 2:25pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/13 "2023-04-20T14:25:59Z")

</div>

Hmm. _ **Eight freaking minutes** _ from suggestion to published code.

I love this community. ❤

---

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 21, 2023, 7:12am UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/14 "2023-04-21T07:12:32Z")

</div>

I have a further question.

Let's say I'd like to also [map a network drive](https://docs.inductiveautomation.com/display/DOC81/Mapping+a+Network+Drive). How should I manage `wrapper.share.1.target=Z:` parameter considering Linux doesn't use letters? Should I write something similar to `wrapper.share.1.target=/mnt/custom_network_drive`?

Moreover, it seems like my Wrapper arguments don't get saved inside of `ignition.conf`. This is my `docker-compose.yaml`:

```
version: "3.8"
services:
    # Ignition Gateway
    gateway:
        container_name: test
        image: inductiveautomation/ignition:8.1.26
        restart: unless-stopped
        mem_limit: 8192m
        ports:
            - "9088:8088"
            - "9043:8043"
        volumes:
            - gw-data:/usr/local/bin/ignition/data
            - ./backup:/mnt/backup # Bind mount backup folder.
        env_file: ignition.env
        secrets:
            - gateway-admin-password
        command: >
            -n GDM-DEV
            -m 8192
            --
            wrapper.java.initmemory=512

secrets:
    gateway-admin-password:
        file: secrets/GATEWAY_ADMIN_PASSWORD

volumes:
    gw-data:
        name: ignition-gw-data

```

But `ignition.conf` (under `/usr/local/bin/ignition/data/`) looks like this:

```
# Java Additional Parameters
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=256

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=1024

```

If I may, I would suggest to add @kcollins script to [this](https://docs.inductiveautomation.com/display/DOC81/Docker+Image#DockerImage-DeployinganEphemeralGatewayforTesting) doc page and how to map network drives on Linux to [this](https://docs.inductiveautomation.com/display/DOC81/Mapping+a+Network+Drive) doc page.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 21, 2023, 12:40pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/15 "2023-04-21T12:40:06Z")

</div>

> [@Davide3i](#):
>
> considering Linux doesn't use letters?

You will have to rethink how you expect this to work, and dedicate a "/remote" or "/mnt" folder to such network resources. You can mount windows network resources in Linux using the kernel's SMB functionality with entries in /etc/fstab. Not sure how to configure docker to do so.

Consider getting this working on a conventional Linux box or VM before trying to get it to work in docker.

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [April 21, 2023, 12:50pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/16 "2023-04-21T12:50:46Z")

</div>

The `wrapper.share.*` functionality is Windows-only, so it won't work on Linux (and therefore the container image).

As to JVM and Wrapper args that follow the `--` delimiter in the command definition, those are intentionally treated as ephemeral overrides. We do have a ticket in our system to have the `-m` flag actually update the `ignition.conf` setting. You'd then still be able to use the JVM/wrapper args to set ephemeral values for other testing.

---

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 21, 2023, 12:53pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/17 "2023-04-21T12:53:41Z")

</div>

Thanks for clarifying. So I suppose there isn't a way to share a remote network folder with the container? I think at this point I can just use a bind mount (but I've to sort out how to authenticate with the network share username and password).

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [April 21, 2023, 1:12pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/18 "2023-04-21T13:12:05Z")

</div>

It looks like there might be some options with creating a SMB/CIFS volume (and then attaching that volume to your container). I've not done it before, though. Some starting reference material here: [Create CIFS/Samba volumes](https://docs.docker.com/storage/volumes/#create-cifssamba-volumes)

---

<div class="post-metadata">

**Author:** ![Davide3i](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/davide3i/32/27811_2.png) [@Davide3i](https://forum.inductiveautomation.com/u/Davide3i)\
**Post date:** [April 21, 2023, 1:24pm UTC](https://forum.inductiveautomation.com/t/docker-set-web-xml-parameters-in-docker-compose/72640/19 "2023-04-21T13:24:05Z")

</div>

Yep, it works. Complete `docker-compose.yaml` for anyone with the same issue.

```
version: "3.8"
services:
    # Ignition Gateway
    gateway:
        container_name: test
        image: inductiveautomation/ignition:8.1.26
        restart: unless-stopped
        mem_limit: 8192m
        ports:
            - "9088:8088"
            - "9043:8043"
        volumes:
            - gw-data:/usr/local/bin/ignition/data
            - nas:/mnt/nas
            - ./backup:/mnt/backup # Bind mount backup folder.
        env_file: ignition.env
        secrets:
            - gateway-admin-password
        command: >
            -n Ignition
            -m 8192
            -r /mnt/backup/test.gwbk
            --
            wrapper.java.initmemory=4096
            -Dignition.allowunsignedmodules=true
            gateway.resolveHostNames=true
            gateway.useProxyForwardedHeader=true
            gateway.max-file-size=41697640

secrets:
    gateway-admin-password:
        file: secrets/GATEWAY_ADMIN_PASSWORD

volumes:
    gw-data:
        name: ignition-gw-data
    nas:
        name: nas
        driver: local
        driver_opts:
            type: cifs
            device: "//192.168.125.XXX/scada"
            o: "addr=192.168.125.XXX,username=admin,password=mildlyComplexPassword,file_mode=0777,dir_mode=0777"

```

My `ignition.env` file:

```
ACCEPT_IGNITION_EULA=Y
GATEWAY_ADMIN_USERNAME=admin
GATEWAY_ADMIN_PASSWORD_FILE=/run/secrets/gateway-admin-password
IGNITION_EDITION=standard
#IGNITION_LICENSE_KEY=XXXX-XXXX
TZ=Europe/Rome

```
