background
In OCI containers, the podman tool mounts a per-network /etc/hosts file into the jail, to provide name resolution between containers. pkg does not like this, and is unable to handle the failure.
issue
During pkg update -r FreeBSD-base the FreeBSD-runtime package includes /etc/hosts as well.
The update will appear to hang, consuming 100% CPU core indefinitely.
procstat was unhelpful but ktrace shows this happening continuously:
99531 pkg NAMI "etc/.[pkgtemp.hosts](http://pkgtemp.hosts/).n1H6tDhSrrjZ"
99531 pkg NAMI "etc/hosts"
99531 pkg NAMI "etc/.[pkgtemp.hosts](http://pkgtemp.hosts/).n1H6tDhSrrjZ"
99531 pkg NAMI "etc/hosts"
99531 pkg NAMI "etc/.[pkgtemp.hosts](http://pkgtemp.hosts/).n1H6tDhSrrjZ"
99531 pkg NAMI "etc/hosts"
...
workaround
For oci containers, add --no-hosts during your podman build or buildah invocation and the /etc/hosts file will not be mounted, avoiding the loop.