-
-
Notifications
You must be signed in to change notification settings - Fork 113
How to run JuNest as a container
In this tutorial we are going to show you how to get a JuNest container and setup an elastic search service. Before starting it is worth to notice that JuNest is not meant to be a real container and there are also several nice alternatives such as docker.
The main advantage of having JuNest as a container is that with JuNest the container comes for free and it requires literally few seconds to get it done! The disadvantages are due to the portability. It is required that the host OS uses systemd as a service manager and, also, the container can only be executed using root privileges.
To run the JuNest container simply:
sudo systemd-nspawn -bD ~/.junest
This will spawn a new systemd for the chrooted container virtualizing the filesystem (as a normal chroot) and the process tree. To install elastic search:
[root@junest ~]# pacman -Syy
[root@junest ~]# pacman -S elasticsearch
[root@junest ~]# systemctl start elasticsearch
From the host OS you can see that the service is running:
[feel@hostos ~]# sudo netstat -tpln | grep 9200
tcp6 0 0 :::9200 :::* LISTEN 6983/java
You can even enable the service so that elastic search will be automatically run when the container is boot up.
[root@junest ~]# systemctl enable elasticsearch