First steps in docker
If you don’t know anything about docker then search the internet for information, there is a lot of information, generally complex and sometimes difficult to understand. Perhaps if you like philosophy and logic you have a better chance of understanding the concepts related to docker. You can start here https://docs.linuxserver.io/. Every docker application (image) thinks it is alone in the universe, without access to our home network, without access to CoreELEC storage space, and without access to hardware. For this reason the startup parameters of the docker (container) application are very important.
To start with CoreELEC docker I recommend that you first install the following add-ons:
- LinuxServer.io’s Docker Add-ons Repository
- Docker
- Docker Image Updater (LinuxServer.io)
- Portainer (LinuxServer.io)
- no more add-ons related to docker because some have errors and do not do what is expected of them
Warnings:
- A docker container (= application) is a docker image added to the execution parameters. I recommend that all containers that need access to storage use the following convention:
Virtual Storage -> Real CoreELEC Storage /storage -> /storage /media -> /media /config -> /storage/.config/dockers/<app_name>/config
(in my CoreELEC /storage/dockers link to /storage/.config/dockers)
-
The main docker image repository is hub.docker.com and the main source of container creation/execution information. Remember to filter the docker images for ‘arm’ processors. Obviously the others will not work
-
Take a little time to understand how Portainer works (http://COREELEC_IP:9000), you will see that it is very useful. For example, you will see that a network has appeared, named ‘bridge’ 172.17.0.0/16 to which the running docker applications are added. All docker applications see the domain ‘bridge’ but do not see others (for example, 192.168.xx.xx / 24) and each docker application has a unique IP address.
-
The
--privileged
parameter is needed to access the hardware (example: internal or USB tuners). I always use the--restart unless-stopped
parameter for obvious reasons. The--net=host
parameter allow access to network interfaces of CoreELEC.
Examples of container creation/execution commands:
tvheadend
docker create \
--name=tvheadend \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Europe/Amsterdam \
-e RUN_OPTS="--satip_xml http://10.10.10.19:9999/desc.xml" \
--net=host \
-v /storage/dockers/tvheadend/config:/config \
-v /storage/dockers/tvheadend/recordings:/recordings \
-v /storage/dockers/tvheadend/picons:/picons \
-v /storage:/storage \
-v /media:/media \
--restart unless-stopped \
--privileged \
linuxserver/tvheadend
Note.- Here tvheadend uses the --net=host
parameter so that it has access to the home network and can use IPTV sources. In this case it is not necessary to publish ports. It also includes a -e RUN_OPTS
parameter to access a remote SATIP tuner at another point on the planet via zerotier.
oscam
docker create \
--name=oscam \
-e PUID=0 \
-e PGID=0 \
-e TZ=Europe/Amsterdam \
--net=host \
-v /storage/dockers/oscam:/config \
--restart unless-stopped \
linuxserver/oscam
syncthing
docker create \
--name=syncthing \
-e PUID=0 \
-e PGID=0 \
-e TZ=Europe/Amsterdam \
-e UMASK_SET=022 \
-p 8384:8384 \
-p 22000:22000 \
-p 21027:21027/udp \
-v /storage/dockers/syncthing/config:/config \
-v /storage:/storage \
-v /media:/media \
--restart unless-stopped \
linuxserver/syncthing
minisatip
docker create \
--name=minisatip \
-e PUID=0 \
-e PGID=0 \
-e TZ=Europe/Amsterdam \
-e RUN_OPTS="" \
-p 8875:8875 \
-p 554:554 \
-p 1900:1900/udp \
-v /storage/dockers/minisatip/config:/config \
--restart unless-stopped \
--privileged \
linuxserver/minisatip
zerotier-one
docker run \
--name zerotier-one \
--device=/dev/net/tun \
--net=host \
--cap-add=NET_ADMIN \
--cap-add=SYS_ADMIN \
--cap-add=SYS_RAWIO \
-v /storage/dockers/zerotier-one:/var/lib/zerotier-one \
--restart unless-stopped \
--privileged \
-d bltavares/zerotier
If you have used zerotier you will know the zerotier-cli command. An easy way to run this command is with Portainer. Go to the zerotier-one container and click “Console”, from there you can already use the command. Example: zerotier-cli join 34b6234ad
PS.- When you find scripts that automate the task of installing applications on the internet, check them out, I have seen some cases in which obsolete versions (zerotier-one, syncthing, …) are installed without the possibility of updating, it seems that the experts want the others learn, but little and for a very short time. Always use reliable repositories.