Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

TrueCommand Auto-Update

Basil Hendroff

Neophyte Sage
Jan 4, 2014
Want to ensure that you're always running the latest version of TrueCommand in a Docker container? Docker Compose is the enabler for automatic updates.

This technique I first used on resources for Nextcloud-OnlyOffice and Nextcloud-Collabora integration. It can be used in a more general sense with other Docker images to keep Docker containers up-to-date, but what better example to demonstrate it on in the FreeNAS forum than TrueCommand.

A check is done daily for a new version of the TrueCommand image. If a new version exists, it is downloaded and the TrueCommand container updated. The old image is then removed.

Outline of the steps
  1. Install TrueCommand using Docker Compose.
  2. Set up automatic updates.
Step 1: Install TrueCommand using Docker Compose

Install Docker Compose. This assumes you already have Docker installed on your Ubuntu host. If not, install Docker first.

In the example below, note that TrueCommand data is stored in a nested folder under the home directory i.e. $HOME/truecommand/data.

sudo docker run --detach -v "$HOME/truecommand/data:/data" -p 8080:80 -p 8081:443 --restart always --name=truecommand -e TZ=Australia/Perth ixsystems/truecommand

Run everything after sudo docker run through Composerize to convert the command to Docker-Compose format.

Change to the TrueCommand folder cd $HOME/truecommand. Create the Compose file nano docker-compose.yml and paste in the output from Composerize.

version: '3.3'
            - '$HOME/truecommand/data:/data'
            - '8080:80'
            - '8081:443'
        restart: always
        container_name: truecommand
            - TZ=Australia/Perth
        image: ixsystems/truecommand

Build and run TrueCommand with Compose sudo docker-compose up -d.

Step 2: TrueCommand Automatic Updates

Make sure you're in the TrueCommand folder cd $HOME/truecommand. Create the script nano and paste the following:

cd "`dirname "$0"`"
docker-compose pull
docker-compose up -d
docker image prune -f

Make the file executable chmod +x

Next, we're going to add a line, that takes the form below, to the system-wide crontab.

m h * * * /path/to/script >> /path/to/log 2>&1

Standard and error output will be appended to /path/to/log. By design, the log file will be placed in the TrueCommand folder as well, so:

/path/to/script = $HOME/truecommand/
/path/to/log = $HOME/truecommand/update.log

However, we need to use the evaluated version of $HOME for the system-wide crontab. Make a note of what this is echo $HOME.

For example:


For this example:

/path/to/script = /home/administrator/truecommand/
/path/to/log = /home/administrator/truecommand/update.log

NOTE: If you've referred to environmental variables such as $HOME in the docker-compose.yml file, these will need to be replaced there as well.

Now, edit the system-wide crontab sudo crontab -e and set up the cron job.

The script should be run at a time when it's unlikely anyone will be using TrueCommand. In the example below, I'm checking for updates daily at half-past midnight.

30 0 * * *  /home/administrator/truecommand/ >> /home/administrator/truecommand/update.log 2>&1

If there isn't an update when the job is run, a typical log entry will look something like the following:


If an update is available, the log entry will instead look more like this:

Last edited:

Patrick M. Hausen

Dedicated Sage
Nov 25, 2013
Works like a charm. Applied it to my onlyoffice container, too. Thanks!


Wizened Sage
Aug 16, 2011
Thanks for this write-up--this is how iX should have configured the VM image to begin with. Slight quibble, though:

This assumes you already have Docker installed on your Ubuntu host. If not, you may find Step 3 of the Nextcloud-OnlyOffice resource useful.
No, it really isn't useful--step 3 in that resource just links to the FreeNAS manual, and that in turn just links to the Docker docs (and not even directly to the installation page). Suggest changing this to (1) give a link to the actual Docker installation instructions (, since you're assuming a Ubuntu host), or (2) better yet, just include the few steps to do the installation (and while you're at it, change the deprecated apt-get to apt).
Run everything after sudo docker run through Comperize
Typo here, the name of the page is Composerize. The link is fine, just the typo in the text.

But with that said, it's up and running. Thanks again.

Basil Hendroff

Neophyte Sage
Jan 4, 2014
@danb35 I've made some changes to the OP based on your feedback. Thank you.