-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (53 loc) · 2.1 KB
/
Copy pathDockerfile
File metadata and controls
57 lines (53 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# SPDX-FileCopyrightText: 2024 Siemens AG
# SPDX-License-Identifier: MIT
FROM debian:13-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV DOTNET_ROOT=/usr/share/dotnet
ENV PATH="${PATH}:${DOTNET_ROOT}"
# Signal to the app (and match the official .NET images) that we're running inside a container.
# PipelineArtifactUploader uses this to skip ##vso[artifact.upload ...] commands, whose paths
# would otherwise reference files that only exist inside the container and not on the pipeline agent.
ENV DOTNET_RUNNING_IN_CONTAINER=true
WORKDIR /app/out
# Install Microsoft package repository and the .NET 10 SDK.
# The SDK is required (not just runtime) because NuGet scanning invokes MSBuildLocator/MSBuild
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
ca-certificates \
gnupg \
apt-transport-https && \
wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y --no-install-recommends \
dotnet-sdk-10.0 && \
apt-get purge -y --auto-remove wget gnupg apt-transport-https && \
rm -rf /var/lib/apt/lists/*
# Creating required directories
RUN mkdir -p \
/opt/DebianImageClearing \
/mnt/Input \
/mnt/Output \
/etc/CATool \
/app/out/PatchedFiles
# Install required packages for CATool clearing flows.#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
nodejs \
npm \
git \
maven \
curl \
dpkg-dev \
openjdk-21-jre-headless && \
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | \
sh -s -- -b /opt/DebianImageClearing v1.46.0 && \
apt-get purge -y --auto-remove curl && \
rm -rf /var/lib/apt/lists/*
ENV PATH="/root/.local/bin:${PATH}"
# Copy the CATool build output (produced by `dotnet build -c Release`) into the image.
# Build output lands in `out/net10.0/` because csproj has <OutputPath>..\..\out</OutputPath>
# and AppendTargetFrameworkToOutputPath defaults to true.
COPY /out/net10.0 /app/out