Docker Build Cannot Access Archive /tmp/apt-dpkg-install Permission Denied

Issue type: Docker Build Cannot Access Archive /tmp/apt-dpkg-install Permission Denied

OS Version/build: Linux debian 5.10.0-7-amd64 #1 SMP Debian 5.10.40-1 (2021-05-28) x86_64 GNU/Linux

App version: Docker version 28.2.1, build 879ac3f

Steps to reproduce:

Installed Docker on Debian Bullseye Host using the Install Docker Engine on Debian (including Post-Install for Non-root users) and confirmed the hello-world image ran successfully as the non-root user.

For added space… I created an NFS mount to the NAS (ext4 volume) and modified the /etc/docker/daemon.json file to reference it.

$ sudo cat /etc/docker/daemon.json 
{
 "data-root": "/media/user/SanDiskSDXC/docker"
}

I can confirm that the docker daemon is successfully using the NFS mount.

However, when I attempt to build a Debian Bullseye Container (as the non-root user), the build errors during the apt-get install phase with “Cannot Access Archive” and “Permission Denied” to the /tmp/apt-dpkg-install directory.

$ docker build docker --pull --tag builder

#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile:
#1 transferring dockerfile: 1.07kB 0.1s done
#1 DONE 1.0s

#2 [internal] load metadata for docker.io/library/debian:11
#2 DONE 1.9s

#3 [internal] load .dockerignore
#3 transferring context:
#3 transferring context: 2B done
#3 DONE 0.6s

#4 [1/7] FROM docker.io/library/debian:11@sha256:cf48c31af360e1c0a0aedd33aae4d928b68c2cdf093f1612650eb1ff434d1c34
#4 CACHED

#5 [2/7] RUN     apt-get update &&     apt-get install -y 	build-essential 	ccache 	clang 	curl 	gawk 	g++-multilib 	gcc-multilib 	genisoimage 	git-core 	gosu 	libdw-dev 	libelf-dev 	libncurses5-dev 	libssl-dev 	locales 	mc 	pv 	pwgen 	python 	python3 	python3-venv 	python3-pip 	python3-pyelftools 	python3-cryptography 	qemu-utils 	rsync 	signify-openbsd 	subversion 	sudo 	swig 	unzip 	wget 	zstd &&     apt-get clean &&     localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
#5 1092.0 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
#5 1092.2 Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [27.2 kB]
#5 1092.4 Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
#5 1094.9 Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8066 kB]
#5 1097.4 Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [371 kB]
#5 1100.9 Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [18.8 kB]
#5 1101.6 Fetched 8643 kB in 10s (891 kB/s)
#5 1101.6 Reading package lists...
#5 1105.3 Reading package lists...
#5 1107.0 Building dependency tree...
#5 1107.3 Reading state information...
...
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/066-libclang-cpp11_1%3a11.0.1-2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/066-libclang-cpp11_1%3a11.0.1-2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/067-libgc1_1%3a8.0.4-3_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/067-libgc1_1%3a8.0.4-3_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/068-libobjc4_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/068-libobjc4_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/069-libobjc-10-dev_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/069-libobjc-10-dev_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/070-libc6-i386_2.31-13+deb11u13_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/070-libc6-i386_2.31-13+deb11u13_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/071-lib32gcc-s1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/071-lib32gcc-s1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/072-lib32stdc++6_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/072-lib32stdc++6_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/073-libclang-common-11-dev_1%3a11.0.1-2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/073-libclang-common-11-dev_1%3a11.0.1-2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/074-libclang1-11_1%3a11.0.1-2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/074-libclang1-11_1%3a11.0.1-2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/075-clang-11_1%3a11.0.1-2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/075-clang-11_1%3a11.0.1-2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/076-clang_1%3a11.0-51+nmu5_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/076-clang_1%3a11.0-51+nmu5_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/077-libbrotli1_1.0.9-2+b2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/077-libbrotli1_1.0.9-2+b2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/078-libsasl2-modules-db_2.1.27+dfsg-2.1+deb11u1_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/078-libsasl2-modules-db_2.1.27+dfsg-2.1+deb11u1_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/079-libsasl2-2_2.1.27+dfsg-2.1+deb11u1_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/079-libsasl2-2_2.1.27+dfsg-2.1+deb11u1_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/080-libldap-2.4-2_2.4.57+dfsg-3+deb11u1_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/080-libldap-2.4-2_2.4.57+dfsg-3+deb11u1_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/081-libnghttp2-14_1.43.0-1+deb11u2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/081-libnghttp2-14_1.43.0-1+deb11u2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/082-librtmp1_2.4+20151223.gitfa8646d.1-2+b2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/082-librtmp1_2.4+20151223.gitfa8646d.1-2+b2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/083-libssh2-1_1.9.0-2+deb11u1_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/083-libssh2-1_1.9.0-2+deb11u1_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/084-libcurl4_7.74.0-1.3+deb11u14_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/084-libcurl4_7.74.0-1.3+deb11u14_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/085-curl_7.74.0-1.3+deb11u14_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/085-curl_7.74.0-1.3+deb11u14_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/086-libassuan0_2.5.3-7.1_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/086-libassuan0_2.5.3-7.1_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/087-gpgconf_2.2.27-2+deb11u2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/087-gpgconf_2.2.27-2+deb11u2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/088-libksba8_1.5.0-3+deb11u2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/088-libksba8_1.5.0-3+deb11u2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/089-libnpth0_1.6-3_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/089-libnpth0_1.6-3_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/090-dirmngr_2.2.27-2+deb11u2_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/090-dirmngr_2.2.27-2+deb11u2_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/091-libfakeroot_1.25.3-1.1_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/091-libfakeroot_1.25.3-1.1_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/092-fakeroot_1.25.3-1.1_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/092-fakeroot_1.25.3-1.1_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/093-fonts-dejavu-core_2.37-2_all.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/093-fonts-dejavu-core_2.37-2_all.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/094-fontconfig-config_2.13.1-4.2_all.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/094-fontconfig-config_2.13.1-4.2_all.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/095-libc6-dev-i386_2.31-13+deb11u13_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/095-libc6-dev-i386_2.31-13+deb11u13_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/096-libc6-x32_2.31-13+deb11u13_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/096-libc6-x32_2.31-13+deb11u13_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/097-libc6-dev-x32_2.31-13+deb11u13_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/097-libc6-dev-x32_2.31-13+deb11u13_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/098-libx32gcc-s1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/098-libx32gcc-s1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/099-lib32gomp1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/099-lib32gomp1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/100-libx32gomp1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/100-libx32gomp1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/101-lib32itm1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/101-lib32itm1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/102-libx32itm1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/102-libx32itm1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/103-lib32atomic1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/103-lib32atomic1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/104-libx32atomic1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/104-libx32atomic1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/105-lib32asan6_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/105-lib32asan6_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/106-libx32asan6_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/106-libx32asan6_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/107-lib32ubsan1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/107-lib32ubsan1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/108-libx32stdc++6_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/108-libx32stdc++6_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/109-libx32ubsan1_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/109-libx32ubsan1_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/110-lib32quadmath0_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/110-lib32quadmath0_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/111-libx32quadmath0_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/111-libx32quadmath0_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/112-lib32gcc-10-dev_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/112-lib32gcc-10-dev_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/113-libx32gcc-10-dev_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/113-libx32gcc-10-dev_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/114-gcc-10-multilib_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/114-gcc-10-multilib_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: error processing archive /tmp/apt-dpkg-install-3FsDL6/115-lib32stdc++-10-dev_10.2.1-6_amd64.deb (--unpack):
#5 2934.1  cannot access archive '/tmp/apt-dpkg-install-3FsDL6/115-lib32stdc++-10-dev_10.2.1-6_amd64.deb': Permission denied
#5 2934.1 dpkg: too many errors, stopping
#5 2934.4 Errors were encountered while processing:
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/066-libclang-cpp11_1%3a11.0.1-2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/067-libgc1_1%3a8.0.4-3_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/068-libobjc4_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/069-libobjc-10-dev_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/070-libc6-i386_2.31-13+deb11u13_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/071-lib32gcc-s1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/072-lib32stdc++6_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/073-libclang-common-11-dev_1%3a11.0.1-2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/074-libclang1-11_1%3a11.0.1-2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/075-clang-11_1%3a11.0.1-2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/076-clang_1%3a11.0-51+nmu5_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/077-libbrotli1_1.0.9-2+b2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/078-libsasl2-modules-db_2.1.27+dfsg-2.1+deb11u1_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/079-libsasl2-2_2.1.27+dfsg-2.1+deb11u1_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/080-libldap-2.4-2_2.4.57+dfsg-3+deb11u1_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/081-libnghttp2-14_1.43.0-1+deb11u2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/082-librtmp1_2.4+20151223.gitfa8646d.1-2+b2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/083-libssh2-1_1.9.0-2+deb11u1_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/084-libcurl4_7.74.0-1.3+deb11u14_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/085-curl_7.74.0-1.3+deb11u14_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/086-libassuan0_2.5.3-7.1_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/087-gpgconf_2.2.27-2+deb11u2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/088-libksba8_1.5.0-3+deb11u2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/089-libnpth0_1.6-3_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/090-dirmngr_2.2.27-2+deb11u2_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/091-libfakeroot_1.25.3-1.1_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/092-fakeroot_1.25.3-1.1_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/093-fonts-dejavu-core_2.37-2_all.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/094-fontconfig-config_2.13.1-4.2_all.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/095-libc6-dev-i386_2.31-13+deb11u13_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/096-libc6-x32_2.31-13+deb11u13_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/097-libc6-dev-x32_2.31-13+deb11u13_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/098-libx32gcc-s1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/099-lib32gomp1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/100-libx32gomp1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/101-lib32itm1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/102-libx32itm1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/103-lib32atomic1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/104-libx32atomic1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/105-lib32asan6_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/106-libx32asan6_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/107-lib32ubsan1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/108-libx32stdc++6_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/109-libx32ubsan1_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/110-lib32quadmath0_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/111-libx32quadmath0_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/112-lib32gcc-10-dev_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/113-libx32gcc-10-dev_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/114-gcc-10-multilib_10.2.1-6_amd64.deb
#5 2934.4  /tmp/apt-dpkg-install-3FsDL6/115-lib32stdc++-10-dev_10.2.1-6_amd64.deb
#5 2934.4 Processing was halted because there were too many errors.
#5 2935.7 E: Sub-process /usr/bin/dpkg returned an error code (1)
#5 ERROR: process "/bin/sh -c apt-get update &&     apt-get install -y \tbuild-essential \tccache \tclang \tcurl \tgawk \tg++-multilib \tgcc-multilib \tgenisoimage \tgit-core \tgosu \tlibdw-dev \tlibelf-dev \tlibncurses5-dev \tlibssl-dev \tlocales \tmc \tpv \tpwgen \tpython \tpython3 \tpython3-venv \tpython3-pip \tpython3-pyelftools \tpython3-cryptography \tqemu-utils \trsync \tsignify-openbsd \tsubversion \tsudo \tswig \tunzip \twget \tzstd &&     apt-get clean &&     localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8" did not complete successfully: exit code: 100
------
 > [2/7] RUN     apt-get update &&     apt-get install -y 	build-essential 	ccache 	clang 	curl 	gawk 	g++-multilib 	gcc-multilib 	genisoimage 	git-core 	gosu 	libdw-dev 	libelf-dev 	libncurses5-dev 	libssl-dev 	locales 	mc 	pv 	pwgen 	python 	python3 	python3-venv 	python3-pip 	python3-pyelftools 	python3-cryptography 	qemu-utils 	rsync 	signify-openbsd 	subversion 	sudo 	swig 	unzip 	wget 	zstd &&     apt-get clean &&     localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8:
2934.4  /tmp/apt-dpkg-install-3FsDL6/108-libx32stdc++6_10.2.1-6_amd64.deb
2934.4  /tmp/apt-dpkg-install-3FsDL6/109-libx32ubsan1_10.2.1-6_amd64.deb
2934.4  /tmp/apt-dpkg-install-3FsDL6/110-lib32quadmath0_10.2.1-6_amd64.deb
2934.4  /tmp/apt-dpkg-install-3FsDL6/111-libx32quadmath0_10.2.1-6_amd64.deb
2934.4  /tmp/apt-dpkg-install-3FsDL6/112-lib32gcc-10-dev_10.2.1-6_amd64.deb
2934.4  /tmp/apt-dpkg-install-3FsDL6/113-libx32gcc-10-dev_10.2.1-6_amd64.deb
2934.4  /tmp/apt-dpkg-install-3FsDL6/114-gcc-10-multilib_10.2.1-6_amd64.deb
2934.4  /tmp/apt-dpkg-install-3FsDL6/115-lib32stdc++-10-dev_10.2.1-6_amd64.deb
2934.4 Processing was halted because there were too many errors.
2935.7 E: Sub-process /usr/bin/dpkg returned an error code (1)
------

 2 warnings found (use docker --debug to expand):
 - MaintainerDeprecated: Maintainer instruction is deprecated in favor of using label (line 4)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 60)
Dockerfile:8
--------------------
   7 |     
   8 | >>> RUN \
   9 | >>>     apt-get update && \
  10 | >>>     apt-get install -y \
  11 | >>> 	build-essential \
  12 | >>> 	ccache \
  13 | >>> 	clang \
  14 | >>> 	curl \
  15 | >>> 	gawk \
  16 | >>> 	g++-multilib \
  17 | >>> 	gcc-multilib \
  18 | >>> 	genisoimage \
  19 | >>> 	git-core \
  20 | >>> 	gosu \
  21 | >>> 	libdw-dev \
  22 | >>> 	libelf-dev \
  23 | >>> 	libncurses5-dev \
  24 | >>> 	libssl-dev \
  25 | >>> 	locales \
  26 | >>> 	mc \
  27 | >>> 	pv \
  28 | >>> 	pwgen \
  29 | >>> 	python \
  30 | >>> 	python3 \
  31 | >>> 	python3-venv \
  32 | >>> 	python3-pip \
  33 | >>> 	python3-pyelftools \
  34 | >>> 	python3-cryptography \
  35 | >>> 	qemu-utils \
  36 | >>> 	rsync \
  37 | >>> 	signify-openbsd \
  38 | >>> 	subversion \
  39 | >>> 	sudo \
  40 | >>> 	swig \
  41 | >>> 	unzip \
  42 | >>> 	wget \
  43 | >>> 	zstd && \
  44 | >>>     apt-get clean && \
  45 | >>>     localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
  46 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update &&     apt-get install -y \tbuild-essential \tccache \tclang \tcurl \tgawk \tg++-multilib \tgcc-multilib \tgenisoimage \tgit-core \tgosu \tlibdw-dev \tlibelf-dev \tlibncurses5-dev \tlibssl-dev \tlocales \tmc \tpv \tpwgen \tpython \tpython3 \tpython3-venv \tpython3-pip \tpython3-pyelftools \tpython3-cryptography \tqemu-utils \trsync \tsignify-openbsd \tsubversion \tsudo \tswig \tunzip \twget \tzstd &&     apt-get clean &&     localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8" did not complete successfully: exit code: 100

I found a previous Docker forum post suggesting the issue might be related to the storage-driver being “overlay2” and recommended changing it to “vfs.” So, I uninstalled, removed all related docker files and directories, reinstalled, and restarted the docker daemon with the following daemon.json file.

$ sudo cat /etc/docker/daemon.json 
{
 "data-root": "/media/user/SanDiskSDXC/docker",
 "storage-driver": "vfs"
}

However, the /tmp/apt-dpkg-install “Cannot Access Archive” and “Permission Denied” error persists.

Your assistance is greatly appreciated.

Thank You.

The data-root is supposed to be on one of the supported backing filesystem, as file locking is required. The same is true for production grade storage drivers.

The documentation says this about vfs:

It is not recommended at atl, except when you want to test things. Running a homelab is not a testing purpose.

Hi @meyay I appreciate you highlighting the use-case scenarios for the “vfs” storage driver, as outlined by the documentation. I was only using the “vfs” storage driver to confirm/test whether the same apt-get “Permission Denied” error occurred, during the build process. As the same issue does occur no matter if I use the “overlay2” or “vfs” storage drivers, I have to believe the problem is rooted elsewhere. Thank you for your response.

This can not work with overlay2. If /media/user/SanDiskSDXC/docker (or one of its parent folders) is a mountpoint to a remote nfs share, then the setup is not using a supported backing filesystem.

So… The issue is that “overlay2” does not support a backing “nfs” file system; even though, the NAS volume is “ext4?”

The problem is that even “vfs” produces the same issue over “nfs” using the same backing “ext4” NAS volume.

Thanks, again.

UPDATE: To test, I added a USB external storage device (ext4 fs) to the docker build server, using “overlay2”, and confirmed that the same Dockerfile successfully executes without the “Permission Denied” issues. It’s a shame that docker can’t be built on a hosted NFS volume. :frowning:

Now it starts to make sense why you mentioned it in the first place. I thought you mean the sdcard has a ext4 filesystem. Yes, the filesystem the nfs server uses is irrelevant. It is relevant what filesystem the docker host sees.

Local filesystems have other capabilities than remote shares. For instance, you can’t use kernel based file watches with remote shares, as the kernel registering the events is the one on your machine.

@meyay Would I be correct to assume that remote storage over a LUN would work as an alternative?

Thanks, again.

When you mount an iSCSI LUN, you basically mount a remote block device as local block device. As long as you format the block device with one of the supported backing filesystems, it will work.

Note: If you choose xfs instead of ext3, make sure to read the docs, as it requires specific features to be set when the filesystem is created.

@meyay Sounds good. I’ll point the data-root to a remote iSCSI LUN and give it a try. Thank you for your guidance.

1 Like

@meyay I created an iSCSI LUN, mounted it to the Build Server, installed Docker, pointed the data-root to the LUN partition, and successfully created a Debian 11 (Bullseye) Docker Container.

It appears that the throughput on the LUN far exceeds that of the NFS share, too.

Thanks, again, for your guidance!

1 Like