GitHub Address
https://github.com/portainer/portainer
Official Docker Documentation
https://docs.portainer.io/start/install-ce/server/docker/linux
Create a docker-compose.yml Configuration File
Since we are not using the Baota panel here, we will use the command line to create it
vi docker-compose.yml
You can see the file editing page
Press ‘i’ to enter editing mode
Right-click to copy the code into the text interface
After editing, press the ESC key to return to command mode
Then press and hold shift + : (colon)
Press ‘w’, ‘q’, and ‘!’ in sequence
Until you see the display as follows in the lower left corner
Press Enter to save and exit
Open Ports
Access the OpenWrt management backend
Go to Network -> Firewall
Enter Communication Rules
Add Router Port
After successful addition, you will see a record
Pull Image and Start Service
docker-compose up
Pulling image and starting
Installation Failed
Insufficient Disk Space
failed to register layer: no space left on device
Click on System -> Mount Points
Check Disk Size and Remaining Space
You can see only a few hundred MB left, which is not enough to download several GB of image files
Check the Root Directory Folder
Create a media folder here (name is arbitrary)
mkdir media
Click to Add Mount Point
Insert External Hard Drive
Click on Devices – Drop Down
See an additional sda3 device identifier of about 250GB (this is the external hard drive just plugged in)
Specify Mount Directory
Click Save and Apply
You can see the mount point list has an additional partition
In the mounted media folder
Create a docker folder, then create a portainer file
Then move the previously created docker-compose.yml configuration file to this folder
Try pulling the image and starting again
Still failed
Probably because the data volume can be placed on the mounted external hard drive
But docker images are downloaded by default in the Linux root file system and will not be placed in the mounted external directory by default
So it is recommended to use a TF card that is as large as possible for OpenWrt firmware, for example, above 128GB, and with a fast read and write speed if possible
This article’s Portainer runs normally on the Raspberry Pi Docker (but it won’t demonstrate Raspberry Pi here)
Because Raspberry Pi 4B and R2S are both ARM64
However, since this R2S is an outdated hardware product, this OpenWrt is an outdated firmware, and this tiny TF card is likely also an old one provided by the seller, there is no extra space available for the upcoming NAS series
A new SanDisk 128GB (V30 A2) TF card has arrived, and the R4S will arrive in a few days, and I will look for the latest R4S firmware after it arrives
In the future, I will record using specific firmware, as each firmware has corresponding functions and management interfaces (changing firmware loses much of the comparison significance)
The docker-compose image operation has exposed the following issues
-
opkg is the installation command for OpenWrt plugins, similar to apt in Ubuntu (Note, OpenWrt cannot use apt to install nano editor, nodeJs, python and other dependencies)
-
Opening ports cannot use commands like ufw, but rather use its management interface UI to open ports (currently, I haven’t researched universal commands that can interact through UI)
-
Mounting external hard drives follows the second point, you cannot use conventional command lines, prioritize UI interaction (after checking online, the UI interaction varies greatly among different OpenWrt firmware, so some scenarios must ensure firmware consistency)
-
The TF card disk must be large and fast in read and write; small capacity supports network configuration without issue, but it is insufficient for using docker services
In the future, I will specifically record the firmware flashing process, and all subsequent operations will be based on the specified firmware and hardware
END
<<OpenWrt Soft Router (NanoPi For NAS All In One R4S): Setting Up SSH and Docker Compose>>