librenms / docker

LibreNMS Docker image
MIT License
681 stars 278 forks source link

access denied #316

Closed DevDorrejo closed 2 years ago

DevDorrejo commented 2 years ago

Behaviour

Steps to reproduce this issue

  1. create rootless container using podman and pods

Expected behaviour

access to the website

Actual behaviour

access denied in website

Configuration

Docker info

host:
arch: amd64
buildahVersion: 1.26.1
cgroupControllers:
- memory
- pids
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.1.3-lp154.8.1.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.1.3, commit: unknown'
cpuUtilization:
idlePercent: 91.13
systemPercent: 3.4
userPercent: 5.46
cpus: 4
distribution:
distribution: '"opensuse-leap"'
version: "15.4"
eventLogger: file
hostname: Zabbix-Server
idMappings:
gidmap:
- container_id: 0
host_id: 100
size: 1
- container_id: 1
host_id: 165536
size: 65536
uidmap:
- container_id: 0
host_id: 1001
size: 1
- container_id: 1
host_id: 165536
size: 65536
kernel: 5.14.21-150400.24.21-default
linkmode: dynamic
logDriver: k8s-file
memFree: 914788352
memTotal: 8327892992
networkBackend: cni
ociRuntime:
name: runc
package: runc-1.1.4-150000.33.4.x86_64
path: /usr/bin/runc
version: |-
runc version 1.1.4
commit: v1.1.4-0-ga916309fff0f
spec: 1.0.2-dev
go: go1.18.5
libseccomp: 2.5.3
os: linux
remoteSocket:
exists: true
path: /run/user/1001/podman/podman.sock
security:
apparmorEnabled: false
capabilities: CAP_AUDIT_WRITE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_MKNOD,CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
rootless: true
seccompEnabled: true
seccompProfilePath: /etc/containers/seccomp.json
selinuxEnabled: false
serviceIsRemote: false
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns-1.1.11-lp154.30.4.x86_64
version: |-
slirp4netns version 1.1.11
commit: unknown
libslirp: 4.3.1-dirty
SLIRP_CONFIG_VERSION_MAX: 3
libseccomp: 2.5.3
swapFree: 0
swapTotal: 0
uptime: 1h 30m 28.17s (Approximately 0.04 days)
plugins:
log:
- k8s-file
- none
- passthrough
- journald
network:
- bridge
- macvlan
- ipvlan
volume:
- local
registries:
search:
- registry.opensuse.org
- docker.io
store:
configFile: /opt/librenms/.config/containers/storage.conf
containerStore:
number: 7
paused: 0
running: 7
stopped: 0
graphDriverName: btrfs
graphOptions: {}
graphRoot: /opt/librenms/.local/share/containers/storage
graphRootAllocated: 53149151232
graphRootUsed: 12644618240
graphStatus:
Build Version: 'Btrfs v5.14 '
Library Version: "102"
imageCopyTmpDir: /var/tmp
imageStore:
number: 4
runRoot: /run/user/1001/containers
volumePath: /opt/librenms/.local/share/containers/storage/volumes
version:
APIVersion: 4.1.1
Built: 1656676800
BuiltTime: Fri Jul  1 08:00:00 2022
GitCommit: ""
GoVersion: go1.16.15
Os: linux
OsArch: linux/amd64
Version: 4.1.1

Logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-fix-logs.sh: executing...
[cont-init.d] 00-fix-logs.sh: exited 0.
[cont-init.d] 01-fix-uidgid.sh: executing...
Switching to PGID 2000...
Switching to PUID 2000...
[cont-init.d] 01-fix-uidgid.sh: exited 0.
[cont-init.d] 02-fix-perms.sh: executing...
Fixing perms...
[cont-init.d] 02-fix-perms.sh: exited 0.
[cont-init.d] 03-config.sh: executing...
Setting timezone to UTC...
Setting PHP-FPM configuration...
Setting PHP INI configuration...
Setting OpCache configuration...
Setting Nginx configuration...
Updating SNMP community...
Initializing LibreNMS files / folders...
Setting LibreNMS configuration...
Checking LibreNMS plugins...
Fixing perms...
Checking additional Monitoring plugins...
Checking alert templates...
[cont-init.d] 03-config.sh: exited 0.
[cont-init.d] 04-svc-main.sh: executing...
Generating APP_KEY and unique NODE_ID
Waiting 60s for database to be ready...
Database ready!
Updating database schema...
Migration table created successfully.
Loading stored database schema: /opt/librenms/database/schema/mysql-schema.dump
Loaded stored database schema. (1,688.22ms)
Migrating: 2020_06_24_155119_drop_ports_if_high_speed
Migrated:  2020_06_24_155119_drop_ports_if_high_speed (12.18ms)
Migrating: 2020_12_14_091314_create_port_group_port_table
Migrated:  2020_12_14_091314_create_port_group_port_table (40.30ms)
Migrating: 2020_12_14_091314_create_port_groups_table
Migrated:  2020_12_14_091314_create_port_groups_table (19.24ms)
Migrating: 2021_02_08_224355_fix_invalid_dates
Migrated:  2021_02_08_224355_fix_invalid_dates (20.97ms)
Migrating: 2021_02_09_084318_remove_perf_times
Migrated:  2021_02_09_084318_remove_perf_times (5.53ms)
Migrating: 2021_02_09_122930_migrate_to_utf8mb4
Migrated:  2021_02_09_122930_migrate_to_utf8mb4 (1,109.70ms)
Migrating: 2021_02_21_203415_location_add_fixed_coordinates_flag
Migrated:  2021_02_21_203415_location_add_fixed_coordinates_flag (8.45ms)
Migrating: 2021_03_11_003540_rename_toner_table
Migrated:  2021_03_11_003540_rename_toner_table (4.77ms)
Migrating: 2021_03_11_003713_rename_printer_columns
Migrated:  2021_03_11_003713_rename_printer_columns (197.91ms)
Migrating: 2021_03_17_160729_service_templates_cleanup
Migrated:  2021_03_17_160729_service_templates_cleanup (46.66ms)
Migrating: 2021_03_26_014054_change_cache_to_mediumtext
Migrated:  2021_03_26_014054_change_cache_to_mediumtext (16.75ms)
Migrating: 2021_04_08_151101_add_foreign_keys_to_port_group_port_table
Migrated:  2021_04_08_151101_add_foreign_keys_to_port_group_port_table (35.20ms)
Migrating: 2021_06_07_123600_create_sessions_table
Migrated:  2021_06_07_123600_create_sessions_table (44.74ms)
Migrating: 2021_06_11_084830_slas_add_rtt_field
Migrated:  2021_06_11_084830_slas_add_rtt_field (28.35ms)
Migrating: 2021_07_06_1845_alter_bill_history_max_min
Migrated:  2021_07_06_1845_alter_bill_history_max_min (9.72ms)
Migrating: 2021_07_28_102443_plugins_add_version_and_settings
Migrated:  2021_07_28_102443_plugins_add_version_and_settings (9.04ms)
Migrating: 2021_08_04_102914_add_syslog_indexes
Migrated:  2021_08_04_102914_add_syslog_indexes (21.48ms)
Migrating: 2021_08_26_093522_config_value_to_medium_text
Migrated:  2021_08_26_093522_config_value_to_medium_text (17.35ms)
Migrating: 2021_09_07_094310_create_push_subscriptions_table
Migrated:  2021_09_07_094310_create_push_subscriptions_table (28.56ms)
Migrating: 2021_09_26_164200_create_hrsystem_table
Migrated:  2021_09_26_164200_create_hrsystem_table (33.77ms)
Migrating: 2021_10_02_190310_add_device_outages_index
Migrated:  2021_10_02_190310_add_device_outages_index (14.89ms)
Migrating: 2021_10_03_164200_update_hrsystem_table
Migrated:  2021_10_03_164200_update_hrsystem_table (16.12ms)
Migrating: 2021_10_20_072929_disable_example_plugin
Migrated:  2021_10_20_072929_disable_example_plugin (0.57ms)
Migrating: 2021_10_20_224207_increase_length_of_attrib_type_column
Migrated:  2021_10_20_224207_increase_length_of_attrib_type_column (19.44ms)
Migrating: 2021_11_12_123037_change_cpwVcID_to_unsignedInteger
Migrated:  2021_11_12_123037_change_cpwVcID_to_unsignedInteger (16.00ms)
Migrating: 2021_11_17_105321_device_add_display_field
Migrated:  2021_11_17_105321_device_add_display_field (9.64ms)
Migrating: 2021_11_29_160744_change_ports_text_fields_to_varchar
Migrated:  2021_11_29_160744_change_ports_text_fields_to_varchar (19.67ms)
Migrating: 2021_11_29_165046_improve_devices_search_index
Migrated:  2021_11_29_165046_improve_devices_search_index (20.17ms)
Migrating: 2021_11_29_165436_improve_ports_search_index
Migrated:  2021_11_29_165436_improve_ports_search_index (32.15ms)
Migrating: 2021_12_02_100709_remove_ports_stp_unique_index
Migrated:  2021_12_02_100709_remove_ports_stp_unique_index (8.54ms)
Migrating: 2021_12_02_101739_add_vlan_field_to_stp_table
Migrated:  2021_12_02_101739_add_vlan_field_to_stp_table (10.21ms)
Migrating: 2021_12_02_101810_add_vlan_and_port_index_fields_to_ports_stp_table
Migrated:  2021_12_02_101810_add_vlan_and_port_index_fields_to_ports_stp_table (8.78ms)
Migrating: 2021_12_02_110154_update_ports_stp_unique_index
Migrated:  2021_12_02_110154_update_ports_stp_unique_index (10.59ms)
Migrating: 2021_12_02_113537_ports_stp_designated_cost_change_to_int
Migrated:  2021_12_02_113537_ports_stp_designated_cost_change_to_int (18.32ms)
Migrating: 2021_25_01_0127_create_isis_adjacencies_table
Migrated:  2021_25_01_0127_create_isis_adjacencies_table (38.95ms)
Migrating: 2021_25_01_0128_isis_adjacencies_add_admin_status
Migrated:  2021_25_01_0128_isis_adjacencies_add_admin_status (8.07ms)
Migrating: 2021_25_01_0129_isis_adjacencies_nullable
Migrated:  2021_25_01_0129_isis_adjacencies_nullable (17.55ms)
Migrating: 2022_02_03_164059_increase_auth_id_length
Migrated:  2022_02_03_164059_increase_auth_id_length (17.00ms)
Migrating: 2022_02_21_073500_add_iface_field_to_bgp_peers
Migrated:  2022_02_21_073500_add_iface_field_to_bgp_peers (8.91ms)
Migrating: 2022_04_08_085504_isis_adjacencies_table_add_index
Migrated:  2022_04_08_085504_isis_adjacencies_table_add_index (9.10ms)
Migrating: 2022_05_25_084506_add_widgets_column_to_users_widgets_table
Migrated:  2022_05_25_084506_add_widgets_column_to_users_widgets_table (9.82ms)
Migrating: 2022_05_25_084617_migrate_widget_ids
Migrated:  2022_05_25_084617_migrate_widget_ids (13.15ms)
Migrating: 2022_05_25_085715_remove_user_widgets_id
Migrated:  2022_05_25_085715_remove_user_widgets_id (14.90ms)
Migrating: 2022_05_25_090027_drop_widgets_table
Migrated:  2022_05_25_090027_drop_widgets_table (5.02ms)
Migrating: 2022_05_30_084932_update-app-status-length
Migrated:  2022_05_30_084932_update-app-status-length (10.38ms)
Migrating: 2022_07_03_1947_add_app_data
Migrated:  2022_07_03_1947_add_app_data (8.26ms)
Migrating: 2022_07_19_081224_plugins_unique_index
Migrated:  2022_07_19_081224_plugins_unique_index (10.62ms)
Migrating: 2022_08_15_091314_create_ports_vdsl_table
Migrated:  2022_08_15_091314_create_ports_vdsl_table (20.18ms)
Migrating: 2022_09_03_091314_update_ports_adsl_table_with_defaults
Migrated:  2022_09_03_091314_update_ports_adsl_table_with_defaults (11.36ms)
Seeding: Database\Seeders\DefaultAlertTemplateSeeder
Seeded:  Database\Seeders\DefaultAlertTemplateSeeder (2.29ms)
Seeding: Database\Seeders\DefaultLegacySchemaSeeder
Seeded:  Database\Seeders\DefaultLegacySchemaSeeder (1.40ms)
Seeding: Database\Seeders\ConfigSeeder
Seeded:  Database\Seeders\ConfigSeeder (83.11ms)
Database seeding completed successfully.
Clear cache
Application cache cleared!
Configuration cache cleared!
Configuration cached successfully!
Creating admin user...
Successfully added user: librenms
[cont-init.d] 04-svc-main.sh: exited 0.
[cont-init.d] 05-svc-dispatcher.sh: executing...
[cont-init.d] 05-svc-dispatcher.sh: exited 0.
[cont-init.d] 06-svc-syslogng.sh: executing...
[cont-init.d] 06-svc-syslogng.sh: exited 0.
[cont-init.d] 07-svc-cron.sh: executing...
Creating LibreNMS daily.sh cron task with the following period fields: 15 0 * * *
Fixing crontabs permissions...
[cont-init.d] 07-svc-cron.sh: exited 0.
[cont-init.d] 08-svc-snmptrapd.sh: executing...
[cont-init.d] 08-svc-snmptrapd.sh: exited 0.
[cont-init.d] ~-socklog: executing...
[cont-init.d] ~-socklog: exited 0.
[cont-init.d] done.
[services.d] starting services
crond: crond (busybox 1.35.0) started, log level 8
[services.d] done.
2022/10/03 17:32:23 [notice] 691#691: using the "epoll" event method
2022/10/03 17:32:23 [notice] 691#691: nginx/1.22.0
2022/10/03 17:32:23 [notice] 691#691: OS: Linux 5.14.21-150400.24.21-default
2022/10/03 17:32:23 [notice] 691#691: getrlimit(RLIMIT_NOFILE): 524288:524288
2022/10/03 17:32:23 [notice] 691#691: start worker processes
2022/10/03 17:32:23 [notice] 691#691: start worker process 723
2022/10/03 17:32:23 [notice] 691#691: start worker process 724
2022/10/03 17:32:23 [notice] 691#691: start worker process 725
2022/10/03 17:32:23 [notice] 691#691: start worker process 726
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
Cannot find module (DISMAN-SCHEDULE-MIB): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (IPV6-ICMP-MIB): At line 0 in (none)
Cannot find module (IPV6-MIB): At line 0 in (none)
Cannot find module (IPV6-TCP-MIB): At line 0 in (none)
Cannot find module (IPV6-UDP-MIB): At line 0 in (none)
Cannot find module (IP-FORWARD-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-PASS-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-EXTEND-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
Cannot find module (NET-SNMP-VACM-MIB): At line 0 in (none)
[03-Oct-2022 17:32:23] NOTICE: fpm is running, pid 697
[03-Oct-2022 17:32:23] NOTICE: ready to handle connections
2022/10/03 17:32:49 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:49 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:32:49 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:49 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:32:50 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:50 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:32:51 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:51 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:32:51 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:51 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:32:51 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:51 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:32:51 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:51 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:32:51 [error] 723#723: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /opt/librenms/html/index.php (Permission denied)" while reading response header from upstream, client: 10.89.0.2, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "10.0.0.105:8000"
10.89.0.2 - - [03/Oct/2022:17:32:51 +0000] "GET / HTTP/1.1" 403 46 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
2022/10/03 17:33:49 [info] 723#723: *3 client timed out (110: Operation timed out) while waiting for request, client: 10.89.0.2, server: 0.0.0.0:8000
2022/10/03 17:33:49 [info] 723#723: *4 client timed out (110: Operation timed out) while waiting for request, client: 10.89.0.2, server: 0.0.0.0:8000

Container script creation

MYSQL_PASSWORD=$(openssl rand -base64 32)

### Containers

mkdir -p db data

podman system reset -f

if ! podman network ls | grep -q librenms; then
    podman network create librenms
fi

podman pod create \
    --label "io.containers.autoupdate=registry" \
    --name librenms_pod \
    --hostname librenms \
    --infra-name librenms_infra \
    --network librenms \
    -p 8000:8000/tcp \
    -p 514:514/tcp \
    -p 162:162/tcp \
    -p 514:514/udp \
    -p 162:162/udp

podman run -d \
    --pod librenms_pod \
    --restart always \
    --label "io.containers.autoupdate=registry" \
    --name librenms_db \
    -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=yes \
    -e MARIADB_DATABASE=librenms_db \
    -e MARIADB_USER=librenms \
    -e MARIADB_PASSWORD="${MYSQL_PASSWORD}" \
    -e MARIADB_AUTO_UPGRADE=yes \
    -v ./db:/var/lib/mysql:U \
    docker.io/mariadb:latest \
    --innodb-file-per-table=1 \
    --lower-case-table-names=0 \
    --character-set-server=utf8mb4 \
    --collation-server=utf8mb4_unicode_ci

podman run -d \
    --pod librenms_pod \
    --restart always \
    --label "io.containers.autoupdate=registry" \
    --name librenms_redis \
    docker.io/redis:latest

podman run -d \
    --requires librenms_db \
    --pod librenms_pod \
    --restart always \
    --label "io.containers.autoupdate=registry" \
    --name librenms \
    -e PUID=2000 \
    -e PGID=2000 \
    -e LISTEN_IPV6=false \
    -e DB_HOST=librenms \
    -e DB_NAME=librenms_db \
    -e DB_USER=librenms \
    -e DB_PASSWORD="${MYSQL_PASSWORD}" \
    -v ./data:/data:U \
    docker.io/librenms/librenms:latest

podman run -d \
    --requires librenms_db \
    --pod librenms_pod \
    --restart always \
    --label "io.containers.autoupdate=registry" \
    --name librenms_dispatcher \
    -e PUID=2000 \
    -e PGID=2000 \
    -e DB_HOST=librenms \
    -e DB_NAME=librenms_db \
    -e DB_USER=librenms \
    -e DB_PASSWORD="${MYSQL_PASSWORD}" \
    -e DISPATCHER_NODE_ID=dispatcher1 \
    -e SIDECAR_DISPATCHER=1 \
    -v ./data:/data:U \
    docker.io/librenms/librenms:latest

podman run -d \
    --requires librenms_db \
    --pod librenms_pod \
    --restart always \
    --label "io.containers.autoupdate=registry" \
    --name librenms_syslogng \
    -e PUID=2000 \
    -e PGID=2000 \
    -e DB_HOST=librenms \
    -e DB_NAME=librenms_db \
    -e DB_USER=librenms \
    -e DB_PASSWORD="${MYSQL_PASSWORD}" \
    -e SIDECAR_SYSLOGNG=1 \
    -v ./data:/data:U \
    docker.io/librenms/librenms:latest

podman run -d \
    --requires librenms_db \
    --pod librenms_pod \
    --restart always \
    --label "io.containers.autoupdate=registry" \
    --name librenms_snmptrapd \
    -e PUID=2000 \
    -e PGID=2000 \
    -e DB_HOST=librenms \
    -e DB_NAME=librenms_db \
    -e DB_USER=librenms \
    -e DB_PASSWORD="${MYSQL_PASSWORD}" \
    -e SIDECAR_SNMPTRAPD=1 \
    -v ./data:/data:U \
    docker.io/librenms/librenms:latest
crazy-max commented 2 years ago

create rootless container using podman and pods

rootless not supported for this image.