Skip to content

Commit 4bff84d

Browse files
committed
chore: update dockerfile
1 parent 01a2a7d commit 4bff84d

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ COPY . /root/build
55
ARG TARGETARCH
66

77
WORKDIR /root/build
8+
89
RUN dotnet publish src/HuaJiBot.NET.CLI \
910
-c Release \
1011
-a $TARGETARCH \
@@ -13,12 +14,14 @@ RUN dotnet publish src/HuaJiBot.NET.CLI \
1314
--framework net10.0 \
1415
-o /root/out
1516

17+
RUN dotnet fsi build_plugins.fsx
18+
1619
FROM mcr.microsoft.com/dotnet/runtime:10.0-azurelinux3.0-distroless
1720

1821
ENV TZ=Asia/Shanghai
1922

20-
# COPY --from=build-env /root/out/HuaJiBot.NET.CLI /app/bin/HuaJiBot.NET.CLI
2123
COPY --from=build-env /root/out /app/bin
24+
COPY --from=build-env /root/build/bin/plugins /app/data/plugins
2225

2326
USER app
2427
WORKDIR /app/data

build_plugins.fsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#r "nuget: SharpCompress, 0.36.0"
1+
#r "nuget: SharpCompress, 0.47.3"
22
open System.IO
33
let isWindows = System.OperatingSystem.IsWindows()
44
let isDebugBuild = isWindows
@@ -89,12 +89,12 @@ for dir in binDirs do
8989
//compress
9090
open SharpCompress.Archives
9191
open SharpCompress.Archives.Zip
92+
open SharpCompress.Common
9293
let compress()=
9394
let zipFile = Path.Combine(cd, "HuaJiBot.NET.Plugins.zip")
9495
if zipFile|>File.Exists then File.Delete zipFile
95-
use archive = ZipArchive.Create()
96+
use archive = ZipArchive.CreateArchive()
9697
archive.AddAllFromDirectory output
97-
use fileStream = File.Create zipFile
98-
archive.SaveTo fileStream|>ignore
98+
archive.SaveTo(zipFile, CompressionType.Deflate) |> ignore
9999
if isWindows then
100100
compress()

0 commit comments

Comments
 (0)