openwrt / openwrt/docker

Docker exits in host network mode

Open
#56 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
625
Forks
103
Avg merge
3d 22h
Merged PRs (30d)
1

Description

Hello!

I want to use OpenWRT on an embedded device running docker. I have observed the following behaviour both on my development laptop and on the target device:

$ time docker run --network host openwrtorg/rootfs:x86-64-19.07.2
/etc/preinit: line 6: can't create /sys/devices/system/cpu/microcode/reload: Read-only file system
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level

real	0m3,011s
user	0m0,045s
sys	0m0,028s

I am using time to give additional data, the same thing happens if I run without it. Also, I believe I need to use the --cap-add NET_ADMIN parameter to allow OpenWRT to make changes, but it does not seem to make a difference for now.

If I start the container using docker run --network host -it openwrtorg/rootfs:x86-64-19.07.2 ash I get a shell and I'm able to do some things, but important services like ubus are not running.

Is this a problem with init? /etc/init.d/rcS doesn't exist even though it's referenced by /etc/inittab. Any help locating the source of the problem would be appreciated!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the host-network run command and inspect the startup paths named in the report: /etc/preinit, /etc/inittab, and /etc/init.d/rcS. Compare that startup behavior with an interactive ash session and determine why services such as ubus do not start; done means explaining the failure and identifying a verified fix or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
embedded-iot, networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.