Skip to content

Commit

Permalink
chore: Update Dockerfile (#10407)
Browse files Browse the repository at this point in the history
chore: update Dockerfile
filzrev authored Nov 21, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent d5b5aac commit c6c87a3
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim
FROM mcr.microsoft.com/dotnet/sdk:8.0-noble

# Add dotnet tools to path.
ENV PATH="${PATH}:/root/.dotnet/tools"

# Set Node.js path
ENV PLAYWRIGHT_NODEJS_PATH="/usr/bin/node"

# Set target docfx version.
ARG DOCFX_VERSION=2.77.0
ARG DOCFX_VERSION=2.78.1

# Install DocFX as a dotnet tool.
RUN dotnet tool install docfx -g --version ${DOCFX_VERSION} && \
docfx --version && \
rm -f /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/docfx.nupkg && \
rm -f /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/docfx.${DOCFX_VERSION}.nupkg && \
rm -rf /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net6.0

# Install Node.js and dependences for chromium PDF.
RUN apt-get update -qq && \
apt-get install -y -qq --no-install-recommends \
nodejs \
libglib2.0-0 libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
libdbus-1-3 libxcb1 libxkbcommon0 libatspi2.0-0 libx11-6 libxcomposite1 libxdamage1 \
libxext6 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 && \
rm -rf /var/lib/apt/lists/* /tmp/*
rm -rf /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net9.0

# Install Chromium.
RUN PLAYWRIGHT_NODEJS_PATH="/usr/bin/node" && \
ln -s /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/.playwright /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net8.0/any/.playwright && \
pwsh -File /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net8.0/any/playwright.ps1 install chromium && \
unlink /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net8.0/any/.playwright
# Install Node.js and browser(chromium) with dependencies
RUN apt-get install -y -qq --update --no-install-recommends nodejs && \
pwsh -File /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net8.0/any/playwright.ps1 install --with-deps chromium && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/*

WORKDIR /opt/prj
VOLUME [ "/opt/prj" ]

0 comments on commit c6c87a3

Please sign in to comment.