-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile_ConsoleImageOptimApi
More file actions
50 lines (39 loc) · 1.68 KB
/
Dockerfile_ConsoleImageOptimApi
File metadata and controls
50 lines (39 loc) · 1.68 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
# Get build image
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /app
# Copy source
COPY . ./
# Run tests if they are present
RUN dotnet restore
# Publish
RUN dotnet publish -c Release -o "/app/publish/ConsoleImageOptimApi" "ConsoleImageOptimApi"
# Get runtime image
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS publish
WORKDIR /app
# Bring in metadata via --build-arg
ARG BRANCH=unknown
ARG IMAGE_CREATED=unknown
ARG IMAGE_REVISION=unknown
ARG IMAGE_VERSION=unknown
# Configure image labels
LABEL branch=$branch \
maintainer="Maricopa County Library District developers <development@mcldaz.org>" \
org.opencontainers.image.authors="Maricopa County Library District developers <development@mcldaz.org>" \
org.opencontainers.image.created=$IMAGE_CREATED \
org.opencontainers.image.description="Console project to exercise the ImageOptimApi NuGet package" \
org.opencontainers.image.documentation="https://github.com/MCLD/SampleImageOptimApi" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.revision=$IMAGE_REVISION \
org.opencontainers.image.source="https://github.com/MCLD/SampleImageOptimApi" \
org.opencontainers.image.title="ConsoleImageOptimApi" \
org.opencontainers.image.url="https://github.com/MCLD/SampleImageOptimApi" \
org.opencontainers.image.vendor="Maricopa County Library District" \
org.opencontainers.image.version=$IMAGE_VERSION
# Default image environment variable settings
ENV org.opencontainers.image.created=$IMAGE_CREATED \
org.opencontainers.image.revision=$IMAGE_REVISION \
org.opencontainers.image.version=$IMAGE_VERSION
# Copy source
COPY --from=build "/app/publish/ConsoleImageOptimApi" .
# Set entrypoint
ENTRYPOINT ["dotnet", "ConsoleImageOptimApi.dll"]