Install openwrt on docker

Hello, I'm new to Openwrt.
The following error occurred while installing openwrt in docker.

configure: error: in `/home/user/openwrt/build_dir/host/tar-1.32':
configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
See `config.log' for more details
make[3]: *** [Makefile:32: /home/user/openwrt/build_dir/host/tar-1.32/.configured] Error 1
make[3]: Leaving directory '/home/user/openwrt/tools/tar'
time: tools/tar/compile#13.87#5.30#27.59
make[2]: *** [tools/Makefile:158: tools/tar/compile] Error 2
make[2]: Leaving directory '/home/user/openwrt'
make[1]: *** [tools/Makefile:154: /home/user/openwrt/staging_dir/host/stamp/.tools_compile_yyyyyynnyyyynyyyyyynyynnyyyynyyyyyyyyyyyyyyynynynnyyyyyyy] Error 2
make[1]: Leaving directory '/home/user/openwrt'
make: *** [/home/user/openwrt/include/toplevel.mk:236: world] Error 2

Avoid using sudo and running commands as root.

Then the following error appears:

rm: cannot remove '/home/user/openwrt/tmp/info/.overrides-packageinfo-17962': Permission denied
bash: /home/user/openwrt/tmp/.ver_check: Permission denied
make[3]: *** No rule to make target '/home/user/openwrt/tmp/info/.files-packageinfo-23809'.  Stop.
cat: /home/user/openwrt/tmp/info/.files-packageinfo-23809: No such file or directory
cat: /home/user/openwrt/tmp/info/.overrides-packageinfo-23809: No such file or directory
rm: cannot remove '/home/user/openwrt/tmp/info/.files-packageinfo.stamp.0bd0347463c0e76a5fffce887d58a2ed': Permission denied
touch: cannot touch '/home/user/openwrt/tmp/info/.files-packageinfo.stamp.d41d8cd98f00b204e9800998ecf8427e': Permission denied
touch: cannot touch '/home/user/openwrt/tmp/info/.files-packageinfo.stamp': Permission denied
make[2]: *** [include/scan.mk:101: /home/user/openwrt/tmp/info/.files-packageinfo.stamp] Error 1
make[1]: *** [/home/user/openwrt/include/toplevel.mk:85: prepare-tmpinfo] Error 2
make: *** [/home/user/openwrt/include/toplevel.mk:234: world] Error 2

You probbaly have done something else with sudo previously.
You'd better start over completely new and do everything as non root user.

1 Like

Repair permissions/ownership:

sudo chown -R $(id -u):$(id -g) ~

Thank you. I'll give it a try.