mrmarkuz
(Markus Neuberger)
September 21, 2021, 11:54pm
9
Docker install seems working:
Netbox-docker install
# install requirements
yum -y install git nethserver-docker
# enable portainer
config setprop portainer status enabled
signal-event nethserver-docker-update
# get docker-compose and set permissions
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# get the docker environment
git clone -b release https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
# write the docker compose config
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
netbox:
ports:
- 8000:8080
EOF
# get and start containers
docker-compose pull
docker-compose up -d
Use portainer to join container “netbox-docker_netbox_1” to the aqua network.
You may open port 8000 by creating a service and browse to http://<NethServer>:8000
or use a name reverse proxy to http://localhost:8000
and login with user admin and password admin
To open port 8000 you may use command line or the web UI.
config setprop netbox status enabled TCPPort 8000 access green,red
signal-event firewall-adjust
Update netbox
cd ~/netbox-docker
docker-compose down
git checkout release && git pull -p origin release
signal-event nethserver-docker-update
docker-compose up -d
Configure netbox to autostart and use aqua network
Edit ~/netbox-docker/docker-compose.override.yml
to look like this:
version: '3.4'
services:
netbox:
ports:
- 8000:8080
restart: unless-stopped
netbox-worker:
restart: unless-stopped
netbox-housekeeping:
restart: unless-stopped
postgres:
restart: unless-stopped
redis:
restart: unless-stopped
redis-cache:
restart: unless-stopped
networks:
default:
external: true
name: aqua
1 Like
fausp
(fpausp)
September 22, 2021, 4:39am
10
Good morning, great news! - will test the steps later…
As a 2nd step I would need to install ansible, how can I connect to the docker machine and install it?
Ansible should use the data from Netbox (API)…
fausp
(fpausp)
September 22, 2021, 8:53am
11
mrmarkuz:
Docker install seems working:
# install requirements
yum -y install git nethserver-docker
# enable portainer
config setprop portainer status enabled
# get docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# get the docker environment
git clone -b release https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
# write the docker compose config
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
netbox:
ports:
- 8000:8080
EOF
# get and start containers
docker-compose pull
docker-compose up -d
Got a permission problem:
Fixed it with chmod…
1 Like
mrmarkuz
(Markus Neuberger)
September 22, 2021, 8:55am
12
Thanks, I forgot to write it down, I corrected my post
fausp
(fpausp)
September 22, 2021, 9:01am
13
No Problem…
Now I am here:
I think this is ok but I cant do the next step:
I try to do this:
Maybe I have to setup the firewall rules, trusted network… because I do it via VPN?
mrmarkuz
(Markus Neuberger)
September 22, 2021, 9:11am
14
You need to signal-event nethserver-docker-update
after config setprop portainer status enabled
to make portainer available, I corrected my post again
Then login to portainer and join the network there.
In Containers click on nethbox-docker_netbox1
Scroll down to the network settings and choose aqua and “Join network”
1 Like
fausp
(fpausp)
September 22, 2021, 10:05am
15
Sorry, cant see any container:
mrmarkuz
(Markus Neuberger)
September 22, 2021, 10:06am
16
Just click once on primary endpoint…
fausp
(fpausp)
September 22, 2021, 10:18am
17
OK, did it - Tried to do the last step:
Open Port 8000 by creating a service?
this is fantastic news. Finally removing the need and dependency of operating many servers, and different variations of servers.
A quick question on Docker.
Does it mean that any software on the internet that has support for docker and has docker install instructions can be installed on Nethserver using the Docker portainer module?
do they include ones with docker image too?
mrmarkuz
(Markus Neuberger)
September 22, 2021, 10:23am
19
Create a service in cockpit:
Add name, port and access
This process opens port 8000 for red and green.
fausp
(fpausp)
September 22, 2021, 10:23am
20
Maybe like this:
config setprop netbox status enabled TCPPort 8000 access green,red
config set netbox service status enabled
1 Like
mrmarkuz
(Markus Neuberger)
September 22, 2021, 10:24am
21
Yes, this is the same process on command line.
These two lines should be enough:
config setprop netbox status enabled TCPPort 8000 access green,red
signal-event firewall-adjust
mrmarkuz
(Markus Neuberger)
September 22, 2021, 10:27am
22
Yes. basically that should work. You need to check for port conflicts, some docker installations assume your local ports 80 and 443 are unused so you need to change ports for example.
Sorry, I don’t understand…
EDIT:
Yes, docker images are supported.
1 Like
would another mail software running inside docker on Nethserver that has nethserver-mail enabled produce conflict, or it will work just as fine.
In this case i am referring to something like mailcow.email | The mailserver suite with the ‘moo’ – + =
fausp
(fpausp)
September 22, 2021, 10:45am
24
Didnt get a response and tried to create a service with:
Now I am here:
mrmarkuz
(Markus Neuberger)
September 22, 2021, 10:47am
25
It’s a challenge because the default mailports are in use locally by nethserver-mail, so you need to use other ports or don’t use local dockerproxy port bindings at all and talk to the container directly (by using aeria or macvlan network)…
mrmarkuz
(Markus Neuberger)
September 22, 2021, 10:49am
26
No, that’s not the right way, you created a service , we only need a network service, see docs .
mrmarkuz
(Markus Neuberger)
September 22, 2021, 10:54am
28
No problem. I used the reverse proxy way and I think shorewall still blocks access to port 8000…I need to check…
For quick testing you may disable shorewall firewall with
shorewall clear
and browse to
http://<nethserver>:8000
To reenable the firewall use
signal-event firewall-adjust