Skip to main content
Update Lager Box software on Lagerboxes with comprehensive progress tracking and automatic configuration.

Syntax

lager update [OPTIONS]

Options

OptionDescription
--box BOXLagerbox name or IP address (required)
--version VERSIONLager Box version/branch to update to (default: main)
--yesSkip confirmation prompt
--skip-restartSkip container restart after update
--check-jlinkCheck for J-Link and offer to install if missing
--verbose / -vShow detailed output (default shows progress bar)

Usage

Basic Update

# Update to latest main branch
lager update --box my-lager-box --yes

# Update to staging branch
lager update --box my-lager-box --version staging --yes

# Update with verbose output
lager update --box my-lager-box --yes --verbose

Skip Container Restart

# Update code but don't restart containers
lager update --box my-lager-box --skip-restart --yes

# Manually restart later
ssh lagerdata@my-lager-box 'cd ~/gateway && ./start_lager.sh'
# Check if J-Link is installed, offer to install if missing
lager update --box my-lager-box --check-jlink --yes

Update Process

The update command performs the following steps (shown in progress bar):
  1. SSH Connection - Establish secure connection to Lager Box
  2. Git Repository Check - Validate lager-mono repository exists
  3. Git Pull - Pull latest code from specified branch
  4. Udev Rules - Install USB instrument access rules
  5. Docker Build - Build updated containers (no-cache)
  6. Firewall Setup - Configure UFW if needed
  7. Customer Binaries - Set up custom binaries directory
  8. J-Link Check - Verify debug probe software (optional)
  9. Version Update - Record version in /etc/lager/version
  10. Container Restart - Start updated containers
  11. Status Verification - Confirm containers are running

Version Tracking

The Lager Box tracks its current version in /etc/lager/version. You can sync versions from all Lager Boxes:
# Sync versions from all configured boxes
lager boxes sync

SSH Key Authentication

The update command automatically detects SSH key configuration:
  • With SSH keys: Updates proceed without password prompts
  • Without SSH keys: Prompts for password (interactive mode)
To set up SSH keys:
ssh-copy-id lagerdata@<gateway-ip>

Firewall Auto-Configuration

If UFW is not configured, the update command will:
  1. Detect missing firewall rules
  2. Offer to install and configure UFW
  3. Apply secure defaults (VPN-only access to Lager ports)
# Manual firewall configuration
cd deployment
./secure_gateway_firewall.sh <gateway-ip>

Examples

# Standard update workflow
lager update --box lab-lager-box --version main --yes

# Update multiple Lager Boxes (run sequentially)
for box in lager-box-1 lager-box-2 lager-box-3; do
  lager update --box $box --version staging --yes
done

# Verbose update for troubleshooting
lager update --box my-lager-box --verbose

Troubleshooting

Update Fails at Git Pull

# Check if deploy key is set up
ssh lagerdata@<gateway-ip> 'cat ~/.ssh/id_ed25519.pub'

# If missing, set up deploy key
cd deployment
./setup_deploy_key.sh <gateway-ip>

Container Build Fails

# SSH in and check Docker status
ssh lagerdata@<gateway-ip>
docker ps -a
docker logs controller

Firewall Issues

# Check firewall status
ssh lagerdata@<gateway-ip> 'sudo ufw status verbose'

# Re-run firewall setup
cd deployment
./verify_gateway_security.sh <gateway-ip> --fix

Notes

  • Progress bar is disabled when --verbose is used
  • Container builds use --no-cache to ensure fresh builds
  • Version defaults to main if not specified
  • Update automatically verifies container health after restart