Skip to content

Commit a1d542f

Browse files
committed
chore: updated compress images function to net6.0
1 parent 633a3ec commit a1d542f

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

CompressImagesFunction/CompressImagesFunction.csproj

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netstandard2.0</TargetFramework>
4-
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
5-
<MagickCopyNativeLinux>true</MagickCopyNativeLinux>
6-
<!-- <RuntimeIdentifiers>linux-x64;osx;win-x64</RuntimeIdentifiers>-->
3+
<TargetFramework>net6.0</TargetFramework>
4+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
5+
<UseAppHost>false</UseAppHost>
76
</PropertyGroup>
87

98
<Target Name="CopyNativeBinaries" AfterTargets="Build">
109
<ItemGroup>
11-
<NativeBinary Include="$(TargetDir)bin/libgit2-106a5f2.so" />
12-
<NativeBinary Include="$(TargetDir)bin/libgit2-106a5f2.dylib" />
13-
<NativeBinary Include="$(TargetDir)bin/git2-106a5f2.dll" />
14-
<NativeBinary Include="$(TargetDir)bin/Magick.Native-Q16-x64.dll.so" />
15-
<NativeBinary Include="$(TargetDir)bin/Magick.Native-Q16-x64.dll.dylib" />
16-
<NativeBinary Include="$(TargetDir)bin/Magick.Native-Q16-x64.dll" />
10+
<NativeBinary Include="$(TargetDir)runtimes/linux-x64/native/libgit2-b7bad55.so" />
11+
<NativeBinary Include="$(TargetDir)runtimes/linux-x64/native/Magick.Native-Q16-x64.dll.so" />
1712
</ItemGroup>
1813
<Copy SourceFiles="@(NativeBinary)" DestinationFiles="@(NativeBinary->'$(TargetDir)bin/%(Filename)%(Extension)')" />
1914
</Target>
2015

2116
<ItemGroup>
22-
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
23-
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="2.0.306" />
17+
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0182" />
2418
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.0.1" />
25-
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="4.0.1" />
26-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.1.0" />
27-
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
28-
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="12.0.1" />
19+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
20+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
21+
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="12.2.0" />
2922
<PackageReference Include="Octokit" Version="0.50.0" />
3023
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
3124
</ItemGroup>
-1.33 MB
Binary file not shown.

Dockerfile.CompressImages

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:3.1-bionic AS dotnet
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS dotnet
22

33
COPY . /src/
44
RUN mkdir -p /home/site/wwwroot
55
RUN cd /src/CompressImagesFunction && dotnet publish CompressImagesFunction.csproj -c Release --output /home/site/wwwroot
66

77
# Native Binaries
8-
# TODO find why the runtimes folder is no longer created on dotnet sdk3.1
9-
RUN cd /src/CompressImagesFunction && cp libgit2-106a5f2.so /home/site/wwwroot/bin/
10-
RUN cd /src/CompressImagesFunction && cp bin/Release/netstandard2.0/Magick.Native-Q16-x64.dll.so /home/site/wwwroot/bin/
8+
RUN cd /src/CompressImagesFunction && cp bin/Release/net6.0/runtimes/linux-x64/native/libgit2-b7bad55.so /home/site/wwwroot/bin/
9+
RUN cd /src/CompressImagesFunction && cp bin/Release/net6.0/runtimes/linux-x64/native/Magick.Native-Q16-x64.dll.so /home/site/wwwroot/bin/
1110

12-
FROM mcr.microsoft.com/azure-functions/dotnet:3.0
11+
FROM mcr.microsoft.com/azure-functions/dotnet:4
1312

1413
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests \
1514
curl libcurl4 autoconf automake libtool nasm make wget pkg-config
1615

17-
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
16+
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
1817
RUN apt-get install -y nodejs
1918
RUN npm install -g svgo@^1.3.2
2019

0 commit comments

Comments
 (0)