m-creations / docker-openwrt-x64

A small Docker image based on OpenWrt http://openwrt.org/
https://registry.hub.docker.com/u/mcreations/openwrt-x64
Apache License 2.0
5 stars 4 forks source link

[question] Does it run opewrt init? #1

Open nicopace opened 7 years ago

nicopace commented 7 years ago

I need to have ubus and supporting systems available. Does this do this?

Thanks in advance!

darabi commented 7 years ago

Hi Nicolás,

yes, it is possible. If you start procd, it will take care of starting the init scripts in /etc/init.d/ including ubus. In the current version, you will get some errors in logread, but it works.

Sample Dockerfile:

FROM mcreations/openwrt-x64

ADD image/root /

RUN opkg update && opkg install libhaproxy libfixposix  &&\
    /etc/init.d/fluvium-net enable

CMD [ "/sbin/init" ]

One problem is that the output of the processes is currently only available with logread which is inconvenient for Docker. But we are working on this during the next weeks.

HTH

Kambiz

nicopace commented 7 years ago

I'm trying to reproduce this on LXC and chroot. May it be that /sbin/init requires it to be PID 1? If that's so... do you know how to run procd through other means? Thanks and sorry for the OT

darabi commented 7 years ago

Sorry I've never tried it on LXC and would have to dig into the code to find out more.

What are the symptoms of it not working? What happens?

nicopace commented 7 years ago

Sorry for the lack of reply.

The way it that it starts a shell, not init... so no services are started up.

darabi commented 7 years ago

If you provide exact instructions on how to run it on LXC (preferably on a debian-like distro), I could look into it.