To use Docker with Nodegrid, you need to enable the service and add a Docker license. If you don't have a Docker license for Nodegrid OS, you can reach out to your account manager or contact support@zpeystems.com. Without a Docker license, your container will be automatically terminated after a few minutes. It is recommended to use a secondary disk for running your container.
The minimum storage disk available varies depending on the Nodegrid device model. For NetSR, GateSR, BoldSR, and NSCP devices, a minimum of 32GB of storage disk is available. HiveSR, LinkSR, and MiniSR devices have a minimum of 16GB. In most cases, you can customize the storage size. To learn more about available storage accessories that you can add to your Nodegrid device, contact your account manager or contact support@zpesystems.com
Nodegrid also allows you to use a USB drive as secondary storage. The following tutorial will guide you through the process of adding your Docker license, setting up the USB drive, and change Docker default path.
Option A: Docker License and Virtualization Service activation from GUI
1. Login in as admin in WebUI
2. Navigate to System :: License and click Add
3. Add docker license key and click Save
4. Navigate to Security :: Services. Under the Enable Virtualization Services section, select Enable Docker. Click Save
5. To allow docker containers to be accessed using IP addresses, you must enable IPv4 IP Forward. To enable this option, navigate to Network :: Settings and select Enable IPv4 IP Forward. Click Save.
Option B: Docker License and Virtualization Service activation from CLI
1. Login in as admin in CLI and go to shell using shell sudo su -
2. Run the following commands. Do not forget to replace <LICENSE> with your docker license key.
#Add License
cd /settings/license/
add
set license_key=<LICENSE>
commit
# Enable Docker
cd /settings/services/
set enable_docker=yes
commit
# Enable IPv4 Forward
cd settings/network_settings/
set enable_ipv4_ip_forward = yes
commit
Check USB path
1. Login in as admin in CLI and go to shell using shell sudo su -
2.
Make sure the external disk is plugged and run command
lsblk -f Nodegrid OS should automatically mount the USB drive in /run/media/sdb1.In this example, the usb device is using NTFS, we must use ext4.
3. Run umount /run/media/sdb1
4. Format partition to ext4 using command mkfs -t ext4 /dev/sdb1
5. Write y and hit enter
6. Run mount /dev/sdb1 /run/media/sdb1
Change Docker default path
1. Login in as admin in CLI and go to shell using shell sudo su -
2. Stop docker service using command /etc/init.d/docker.init stop
3. Move the folder to the desired location, for example to sdb1: mv /var/lib/docker /run/media/sdb1/.
You can see your filesystem using command df -h
4. Edit or create the daemon.json file using vi /etc/docker/daemon.json
5. Add the new path to your file "data-root": "/run/media/sdb1/docker"
Note: Add coma after the first parameter and then, the information data-root.
Save and close the file.
6. Start docker using command /etc/init.d/docker.init start