Skip to content

Instantly share code, notes, and snippets.

@onnimonni
Last active August 8, 2018 11:24
Show Gist options
  • Save onnimonni/84489397082b8af71772113697de86b3 to your computer and use it in GitHub Desktop.
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
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/*
@McMac
Copy link

McMac commented Aug 8, 2018

Have you tried this with debian:stretch? Took this file and updated references to stretch however still get the System error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment