Last active
August 8, 2018 11:24
-
-
Save onnimonni/84489397082b8af71772113697de86b3 to your computer and use it in GitHub Desktop.
How to fix cron and su 'System error' with debian and docker running with --net=host option. https://github.com/docker/docker/issues/5899
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:jessie | |
MAINTAINER Onni Hakala <onni.hakala@geniem.com> | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN set -x \ | |
# Add all deb-src addresses | |
&& echo "deb http://deb.debian.org/debian jessie main\n\ | |
deb-src http://deb.debian.org/debian jessie main\n\ | |
deb http://deb.debian.org/debian jessie-updates main\n\ | |
deb-src http://deb.debian.org/debian jessie-updates main\n\ | |
deb http://security.debian.org jessie/updates main\n\ | |
deb-src http://security.debian.org/ jessie/updates main" > /etc/apt/sources.list \ | |
# Update sources and upgrade all packages | |
&& apt-get update -y \ | |
&& apt-get upgrade -y \ | |
## | |
# Rebuild pam with --disable-audit flag | |
# Fixes: https://github.com/docker/docker/issues/5899 | |
## | |
&& apt-get -y build-dep pam \ | |
&& cd /tmp/ \ | |
&& export CONFIGURE_OPTS=--disable-audit \ | |
&& apt-get -b source pam \ | |
&& dpkg -i libpam-doc*.deb libpam-modules*.deb libpam-runtime*.deb libpam0g*.deb \ | |
&& rm -rf /tmp/* \ | |
&& unset CONFIGURE_OPTS \ | |
# Cleanup | |
&& apt-get remove --purge -y $(apt-mark showauto) \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/log/apt/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you tried this with debian:stretch? Took this file and updated references to stretch however still get the System error.