Nature40 / pimod

Reconfigure Raspberry Pi images with an easy, Docker-like configuration file
GNU General Public License v3.0
127 stars 19 forks source link

/etc/resolv.conf: networking not working properly #54

Closed sensslen closed 2 years ago

sensslen commented 2 years ago

In our build process we are using apt-cacher in order to capture all apt packages being installed. To do so, we spin up an apt cacher docker container (sameersbn/apt-cacher-ng:latest).

Intrestingly HOST curl http://apt-cacher-ng:3142 works as expected when put into a pifile where RUN curl http://apt-cacher-ng:3142 does not (of course I did make sure that curl ist installed both on the host and on the target).

I found that the issue comes from the fact that /etc/resolv.conf is only replaced if it does not exist. When overwriting it with the hosts information all is well (see PR). I currently don't see a reason for the current replacement strategy.

oxzi commented 2 years ago

In 1386db68dd0bb6967d3d99944e4cbf3a5c27ab8b, I have introduced a new --host-resolv flag for pimod to always bind mount the host's /etc/resolv.conf file. This commit continued where #55 left off.

@sensslen: Could you please test and post your feedback. Thanks.

sensslen commented 2 years ago

This does indeed resolve this concrete issue.