Skip to content

Instantly share code, notes, and snippets.

@dmrub
Last active May 8, 2024 17:07
Show Gist options
  • Save dmrub/b311d36492f230887ab0743b3af7309b to your computer and use it in GitHub Desktop.
Save dmrub/b311d36492f230887ab0743b3af7309b to your computer and use it in GitHub Desktop.
Dockerfile piece for installing su-exec in debian/ubuntu container
# Install latest su-exec
RUN set -ex; \
\
curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \
\
fetch_deps='gcc libc-dev'; \
apt-get update; \
apt-get install -y --no-install-recommends $fetch_deps; \
rm -rf /var/lib/apt/lists/*; \
gcc -Wall \
/usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \
chown root:root /usr/local/bin/su-exec; \
chmod 0755 /usr/local/bin/su-exec; \
rm /usr/local/bin/su-exec.c; \
\
apt-get purge -y --auto-remove $fetch_deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment