Trying to get a Netbox from dockerhub running


tknx

Recommended Posts

So figured I would try and standup netbox. I get it mostly running but in the end, it just goes to Stopped on its owne

 

1. First I pulled the offical postgres docker; Fixed IP address: 10.0.1.61; set variable POSTGRES_PASSWORD and POSTGRES_USER

2. Connected to it and added user: netbox and a netbox database

3. Pulled down netbox from dockerhub and set the following variables:

  • Network type: custom: br0
  • Fixed IP address: 10.0.1.7
  • DB_NAME=netbox
  • DB_USER=netbox
  •  DB_PASSWORD=(password)
  • DB_HOST=10.0.1.61
  • TIME_ZONE=America/Los_Angeles
  • ALLOWED_HOSTS=0.0.0.0/24
  • SECRET_KEY=(a 50 character random string generated elsewhere)
  • CACHEOPS_ENABLED=false

 

No idea what cacheops is, but I was getting errors in the log, so figured I would just turn it off.

 

Full log here:

Operations to perform:
Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization
Running migrations:
No migrations to apply.
💡 Superuser Username: admin, E-Mail: [email protected]
Running /opt/netbox/startup_scripts/000_users.py
Running /opt/netbox/startup_scripts/010_groups.py
Running /opt/netbox/startup_scripts/020_custom_fields.py
Running /opt/netbox/startup_scripts/030_regions.py
Running /opt/netbox/startup_scripts/040_sites.py
Running /opt/netbox/startup_scripts/050_manufacturers.py
Running /opt/netbox/startup_scripts/060_device_types.py
Running /opt/netbox/startup_scripts/070_rack_roles.py
Running /opt/netbox/startup_scripts/075_rack_groups.py
Running /opt/netbox/startup_scripts/080_racks.py
Running /opt/netbox/startup_scripts/090_device_roles.py
Running /opt/netbox/startup_scripts/100_platforms.py
Running /opt/netbox/startup_scripts/110_tenant_groups.py
Running /opt/netbox/startup_scripts/120_tenants.py
Running /opt/netbox/startup_scripts/130_devices.py
Running /opt/netbox/startup_scripts/140_cluster_types.py
Running /opt/netbox/startup_scripts/150_rirs.py
Running /opt/netbox/startup_scripts/160_aggregates.py
Running /opt/netbox/startup_scripts/170_clusters.py
Running /opt/netbox/startup_scripts/180_vrfs.py
Running /opt/netbox/startup_scripts/190_prefix_vlan_roles.py
Running /opt/netbox/startup_scripts/200_vlan_groups.py
Running /opt/netbox/startup_scripts/210_vlans.py
Running /opt/netbox/startup_scripts/220_prefixes.py
Running /opt/netbox/startup_scripts/230_virtual_machines.py
Running /opt/netbox/startup_scripts/240_virtualization_interfaces.py
Running /opt/netbox/startup_scripts/250_dcim_interfaces.py
Running /opt/netbox/startup_scripts/260_ip_addresses.py

980 static files copied to '/opt/netbox/netbox/static'.
 Initialisation is done.
/opt/netbox/docker-entrypoint.sh: line 76: exec: -p: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]

 

Link to comment
  • 4 weeks later...

Still stuck at the same point. What I've noticed I can map /opt/netbox to /mnt/user/appdata/netbox but it definitely behaves oddly and wants to map each sub-path separately - so i need to map /opt/netbox/netbox/static to /mnt/user/appdata/netbox/netbox/static and so forth...

 

Not sure why the docker isn't working right, it won't route subdirectories correctly...

 

 

 

 

Link to comment
  • 4 weeks later...

@SpyKiller I got nipap running for the most part:

 

1 - Set up Postgres with IP4R

You need to first setup a postgres DB docker with IP4R. I just used the official docker and then added the IP4R update. I consoled into the docker and used this: https://www.gab.lc/articles/manage_ip_postgresql_with_ip4r/

 

2- Install Nipapd

For nipapd, you need to set ENV Variables for:

DB_HOST

DB_NAME

DB_USERNAME
DB_PASSWORD

NIPAP_USERNAME

NIPAP_PASSWORD

 

4- Install Nipap-www

 

NIPAPD_USERNAME (same as above)

NIPAPD_PASSWORD (same)

NIPAPD_HOST

WWW_USERNAME

WWW_PASSWORD

 

That should get you up and running with Nipap.

 

===> No luck on netbox. Can't get it to see the static files even though they are in the right place. I'll probably keep plugging away at it, but the people on the Slack are intermittently on and only occasionally respond. There is even a post about how the docker is complex. Which, for IPAM, seems pretty silly, but is typical overoptioning in FOSS stuff.

 

Link to comment
  • 1 month later...
  • 2 months later...
On 5/25/2020 at 8:19 AM, knalbone said:

I'm giving this one a try myself. I have the container installed and connected to Postgres. The only problem is I can't login! admin:admin doesn't work and I'm not sure how you set the password for the container. Anyone have any ideas?

Not sure if you ever got this to work or not but i'm a few months later and have found a way in.

 

Get into the CLI of the docker container and run ./manage.py createsuperuser

 

It will ask for you to create an admin account with email, and password of your option.  I guess netbox doesn't create a user by default and requires a manual initiation of it.  I did get an error prior to entering the username field, but i'd imagine it's passive error looking for a cache area that can be ignored.

 

References: 

https://github.com/netbox-community/netbox/issues/364

https://github.com/pitkley/docker-netbox

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.