OpenWRT docker image with LUCI

Hello,

I have been trying to run openwrt as a container. I got the image from: https://downloads.openwrt.org/. It looks good, but I am having problems with Luci, basically is not there. I think I should see uhttpd in the init.d directory, but it is empty:
/etc/init.d # ls
/etc/init.d #

I have been looking online and none of the suggested solutions seem to work for me:

/etc/init.d # ls
/etc/init.d #

  1. . apk add luci
    / # apk add luci
    ERROR: unable to select packages:
    luci (no such package):
    required by: world[luci]
    I have looked into that error and it is clear the repositores in my container does not contain luci:
    / # tail -f /etc/apk/repositories
    https://dl-cdn.alpinelinux.org/alpine/v3.18/main
    https://dl-cdn.alpinelinux.org/alpine/v3.18/community

I have looked here: https://pkgs.alpinelinux.org/packages?name=luci&branch=edge&repo=&arch=x86_64&origin=&flagged=&maintainer=
But don't see luci listed ...

I have also tried with opkg but get the same error and don't know which repository I can use.

It has been a few days and I am quite frustrated. Any help will be apprettiated!

Thanks!

Your container does not run OpenWrt in the first place.

I guess I am using an incorrect term? These are my container logs:

oot@lab:~$ docker logs -f 7021d9250eb1
/launch.py:9: DeprecationWarning: 'telnetlib' is deprecated and slated for removal in Python 3.13
import telnetlib
2025-06-19 16:10:14,237: vrnetlab DEBUG class: OpenWRT_vm, disk_image: /openwrt-24.10.0-x86-64-generic-ext4-combined.img, overlay: /openwrt-24.10.0-x86-64-generic-ext4-combined-overlay.img
2025-06-19 16:10:14,237: vrnetlab DEBUG Creating overlay disk image
2025-06-19 16:10:14,251: vrnetlab DEBUG Starting vrnetlab OpenWRT
2025-06-19 16:10:14,251: vrnetlab DEBUG VMs: [<main.OpenWRT_vm object at 0x7b40e0336d50>]
2025-06-19 16:10:14,251: vrnetlab DEBUG VM not started; starting!
2025-06-19 16:10:14,251: vrnetlab INFO ----------------START ENVIRONMENT VARIABLES-----------------
2025-06-19 16:10:14,251: vrnetlab INFO HOME: /root
2025-06-19 16:10:14,251: vrnetlab INFO HOSTNAME: 7021d9250eb1
2025-06-19 16:10:14,251: vrnetlab INFO PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2025-06-19 16:10:14,251: vrnetlab INFO -----------------END ENVIRONMENT VARIABLES------------------
2025-06-19 16:10:14,251: vrnetlab INFO Launching OpenWRT_vm with 1 SMP/VCPU and 128 M of RAM
2025-06-19 16:10:14,251: vrnetlab INFO Scrapli: Disabled
2025-06-19 16:10:14,251: vrnetlab INFO Transparent mgmt interface: Disabled
2025-06-19 16:10:14,252: vrnetlab DEBUG number of provisioned data plane interfaces is 0
2025-06-19 16:10:14,252: vrnetlab DEBUG qemu cmd: qemu-system-x86_64 -enable-kvm -display none -machine pc -monitor tcp:0.0.0.0:4000,server,nowait -serial telnet:0.0.0.0:5000,server,nowait -m 128 -cpu host -smp 1 -drive if=ide,file=/openwrt-24.10.0-x86-64-generic-ext4-combined-overlay.img -device pci-bridge,chassis_nr=1,id=pci.1 -device virtio-net-pci,netdev=p00,mac=0C:00:78:7e:a7:00 -netdev user,id=p00,net=10.0.0.0/24,host=10.0.0.2,dns=10.0.0.3,dhcpstart=10.0.0.15,hostfwd=tcp:0.0.0.0:22-10.0.0.15:22,hostfwd=udp:0.0.0.0:161-10.0.0.15:161,hostfwd=tcp:0.0.0.0:80-10.0.0.15:80,hostfwd=tcp:0.0.0.0:443-10.0.0.15:443,hostfwd=tcp:0.0.0.0:830-10.0.0.15:830,hostfwd=tcp:0.0.0.0:6030-10.0.0.15:6030,hostfwd=tcp:0.0.0.0:8080-10.0.0.15:8080,hostfwd=tcp:0.0.0.0:9339-10.0.0.15:9339,hostfwd=tcp:0.0.0.0:32767-10.0.0.15:32767,hostfwd=tcp:0.0.0.0:57400-10.0.0.15:57400,tftp=/tftpboot
2025-06-19 16:10:29,276: launch DEBUG VM started
2025-06-19 16:10:29,276: launch INFO applying bootstrap configuration
'025-06-19 16:10:29,276: vrnetlab DEBUG writing to serial console: '
2025-06-19 16:10:29,276: vrnetlab INFO waiting for '#' on serial console
2025-06-19 16:10:29,307: vrnetlab INFO read from serial console: ': port 1(eth0) entered blocking state
[ 8.021101] br-lan: port 1(eth0) entered disabled state
[ 8.021775] virtio_net virtio0 eth0: entered allmulticast mode
[ 8.022611] virtio_net virtio0 eth0: entered promiscuous mode
[ 8.030480] br-lan: port 1(eth0) entered blocking state
[ 8.031214] br-lan: port 1(eth0) entered forwarding state

BusyBox v1.36.1 (2025-02-03 23:09:37 UTC) built-in shell (ash)


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt 24.10.0, r28427-6df0e3d02a

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.

apk update
apk add luci

I have tried thta and I get this:

/ # apk update

fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz

fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz

v3.18.12-136-gf28e1c9c9f8 [https://dl-cdn.alpinelinux.org/alpine/v3.18/main]

v3.18.12-132-ge2ea6f61358 [https://dl-cdn.alpinelinux.org/alpine/v3.18/community]

OK: 20070 distinct packages available

/ # apk add luci

ERROR: unable to select packages:

luci (no such package):

required by: world[luci]

Wait a second, if you're using 24.10, then it doesn't have apk, but the older opkg, so you should use:

opkg update
opkg install luci

Note: apk is used only in snapshots.

Please format your output and show ubus call system board from container console.

I guess I am using a snapshot then:

Something is very wrong with the image I used probably:

Please edit your post and paste text as formatted text </>

Youll need to figure that out yourself. OpenWrt commands do not apply to alpine linux you are typing them at.

1 Like

a) running OpenWrt in a container (contrary to a VM) is not a supported setup
b) it does not work
c) it rips open subtle or huge security holes while trying
d) don't do it, use a VM

1 Like

In this case it is kvm container with raw disks, just that OP tries to run openwrt commands on host system...

1 Like