If it’s for testing purposes only (not for development), it’s better to launch a Docker image « in real conditions » rather than doing this in a development environment (which doesn’t really reflect reality and isn’t necessarily easy to set up).
To launch a Docker image, the process is the same as described on the Gladys installation page via Docker (Installation avec Docker | Gladys Assistant), i.e., launching a Docker container on the machine where you want to test Gladys (as close as possible to what you have in production, a Raspberry Pi for example).
The only difference is that you need to change the name of the image in the docker run (to launch an image generated by another developer), and to set volumes that correspond to your test environment.
Let’s break down the docker run command from the site:
docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name gladys \
-e NODE_ENV=production \
-e SERVER_PORT=80 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
gladysassistant/gladys:v4
Here you notice that at the end, we specify that we want to launch a container from the image gladysassistant/gladys:v4, this is the « official » image that we distribute ![]()
In the case of a test scenario, for example in the case of the RFLink PR, @ProtZ shared a Docker image on his personal Docker Hub account, and the image is named ngeissel/gladys:rflinkdev.
If you want to launch an RFLink test image on your Pi, I can suggest the following command:
docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name gladys-test-rflink \
-e NODE_ENV=production \
-e SERVER_PORT=8001 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant_test_rflink:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
ngeissel/gladys:rflinkdev
You will notice several changes:
- I changed the name of the container to « gladys-test-rflink » to avoid a conflict if you already have a Gladys running.
- I changed the port on which Gladys listens to 8001 to avoid a conflict if you already have a Gladys running.
- I changed the Gladys data volume (folder in which Gladys data will be mounted on the disk), here to set « /var/lib/gladysassistant_test_rflink » (Thus, if you want to clean your pi after running this file, you just need to delete this folder).
- I changed the image to « ngeissel/gladys:rflinkdev ».
Once your container is running, you will be able to access Gladys by typing « IP_RASPBERRY_PI:8001 ».
If you want to stop this container:
docker stop gladys-test-rflink
If you want to delete this container:
docker rm gladys-test-rflink
If you want to fetch a new version of the image
(if the developer has made progress on his integration):
docker pull ngeissel/gladys:rflinkdev
Note that a Docker container is immutable: if you have pulled a new image, you need to stop the container, delete the container, and then docker run a new container ![]()
Conclusion
Here is an example in the case of RFLink, but you can change the name of the image to whatever you want.
It might be Chinese if you don’t know Docker, in my opinion it’s worth reading the Docker basics if you don’t know much about it ![]()
The Sonoff Ewelink is already merged and available in Gladys 4 for a while now! ![]()