Skip to content

error during container init: error mounting "/etc/timezone" to rootfs at "/etc/timezone"

Hi!

I was trying to build this repo to bring forward some modifications to the device tree of our DI/OT system, but this error came up:

$ make diot_v2.build

[...]

docker run -w/home/vnappi/diot-debian/kernel/projects/diot_v2 -v/home/vnappi/diot-debian/kernel/projects/diot_v2:/home/vnappi/diot-debian/kernel/projects/diot_v2 -v /home/vnappi:/home/vnappi -v /etc/group:/etc/group:ro -v /etc/localtime:/etc/localtime:ro -v /etc/passwd:/etc/passwd:ro -v /etc/shadow:/etc/shadow:ro -v /etc/timezone:/etc/timezone:ro -v /tmp:/tmp -v /tmp/.X11-unix:/tmp/.X11-unix -v /opt/Xilinx:/opt/Xilinx -v /var/run/dbus:/var/run/dbus -e DISPLAY=:1 -u $(id -u):$(id -g) --privileged -t gitlab-registry.cern.ch/be-cem-edl/diot/docker-util/xilinx_tools:latest /bin/bash -c "source /opt/Xilinx/Vitis/2022.2/settings64.sh && make -C /home/vnappi/diot-debian/kernel/projects/diot_v2/work_dir CROSS_COMPILE=aarch64-none-elf- ARCH=arm64 diot_defconfig -j8 O=/home/vnappi/diot-debian/kernel/projects/diot_v2/work_dir/build-arm64"
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/etc/timezone" to rootfs at "/etc/timezone": mount /etc/timezone:/etc/timezone (via /proc/self/fd/7), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
ERRO[0000] error waiting for container: context canceled 
make[1]: *** [../Makefile.rules:77: compile_config] Error 125
make[1]: Leaving directory '/home/vnappi/diot-debian/kernel/projects/diot_v2'
make: *** [Makefile:40: diot_v2.build] Error 2

I'm on Arch linux, and from my research this appears to be related. Removing -v /etc/timezone:/etc/timezone:ro from projects/Makefile.rules does the trick

Not really a show-stopper for me but I thought you may want to be aware of this!

Cheers!

Edited by Valerio Nappi