Use a single RUN command to install SkiaSharp dependencies (#1511)

Wherever possible, it's best to combine multiple RUN commands into a single command to reduce the number of layers and subsequent image size of Docker images. This updates the examples to follow this pattern.
This commit is contained in:
Brant Burnett 2024-11-08 09:24:09 -05:00 коммит произвёл GitHub
Родитель 807f8b5b75
Коммит 2318d291fb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -161,9 +161,8 @@ The next libraries should also be referenced when using SkiaSharp. The snippet i
````
FROM microsoft/dotnet:7.0-runtime AS base
RUN apt-get update
RUN apt-get install -y libfreetype6
RUN apt-get install -y libfontconfig1
RUN apt-get update && \
apt-get install -y libfreetype6 libfontconfig1
````
### Linux Docker Container with System.Drawing(`libgdiplus`)
@ -206,9 +205,8 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
RUN apt-get update
RUN apt-get install -y libfreetype6
RUN apt-get install -y libfontconfig1
RUN apt-get update && \
apt-get install -y libfreetype6 libfontconfig1
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release