Skip to content

Instantly share code, notes, and snippets.

@haliphax
Last active April 14, 2022 17:48
Show Gist options
  • Save haliphax/aac133db7da33ddd83dc60b536f5cd3b to your computer and use it in GitHub Desktop.
Save haliphax/aac133db7da33ddd83dc60b536f5cd3b to your computer and use it in GitHub Desktop.
Containerized docfx
FROM mono:6.8
ARG DOCFX_VERSION=2.59.2
ARG APT_PROXY
RUN /bin/bash -c " \
if [ -n \"${APT_PROXY}\" ]; then \
echo 'Acquire::http { Proxy \"${APT_PROXY}\"; };' \
>> /etc/apt/apt.conf.d/01proxy; \
fi" && \
apt-get update && \
apt-get install -y \
--no-install-recommends \
--no-install-suggests \
aria2 git unzip && \
aria2c -x 16 -k 1M -j 4 -o /tmp/docfx.zip https://github.com/dotnet/docfx/releases/download/v${DOCFX_VERSION}/docfx.zip && \
unzip /tmp/docfx.zip -d /opt/docfx && \
rm /tmp/docfx.zip && \
apt-get purge -y aria2 unzip && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
adduser \
--home /nonexistent \
--shell /bin/false \
--no-create-home \
--gecos "" \
--disabled-password \
--disabled-login \
docfx && \
chown -R docfx:docfx /opt/docfx
USER docfx
ENTRYPOINT ["mono", "/opt/docfx/docfx.exe"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment