The error I encountered was only slightly different, instead of deb9u2, I got it on deb9u3:
Unable to correct missing packages. E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/l/linux/linux-libc-dev_4.9.168-1+deb9u3_amd64.deb 404 Not Found The solution I found was to simply change " http://security.debian.org/debian-security" in sources.list to " http://deb.debian.org/debian-security". I do not understand why the URL alias failed on only this package. RUN sed -i "s#deb http://security.debian.org/debian-security stretch/updates main#deb http://deb.debian.org/debian-security stretch/updates main#g" /etc/apt/sources.list Thereafter I can build normally.