Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Bb]in/
[Oo]bj/
1 change: 1 addition & 0 deletions ComponentDetection.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
Dockerfile = Dockerfile
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F452E8E5-D1AB-4B67-9FFC-5974EA1A8584}"
Expand Down
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM mcr.microsoft.com/dotnet/sdk:3.1-cbl-mariner1.0 AS build
WORKDIR /app
COPY . .
RUN dotnet publish -c Release -o out \
-r linux-x64 \
-p:MinVerSkip=true \
--self-contained true \
-p:PublishReadyToRun=false \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:TrimUnusedDependencies=true \
./src/Microsoft.ComponentDetection

FROM mcr.microsoft.com/dotnet/runtime-deps:3.1-cbl-mariner1.0 AS runtime
WORKDIR /app
COPY --from=build /app/out ./

RUN tdnf install -y \
golang \
moby-engine \
gradle \
maven \
pnpm \
poetry \
python

ENTRYPOINT ["/app/Microsoft.ComponentDetection"]
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public async Task TestNugetDetector_ReturnsValidPaketComponent()
.ExecuteDetector();

Assert.AreEqual(ProcessingResultCode.Success, scanResult.ResultCode);
// While there are 26 lines in the sample, several dependencies are identical, so there are only 11 matches.
// While there are 26 lines in the sample, several dependencies are identical, so there are only 11 matches.
Assert.AreEqual(11, componentRecorder.GetDetectedComponents().Count());
}

Expand Down