forked from Cingulara/nats-client-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (26 loc) · 1011 Bytes
/
Dockerfile
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
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
RUN mkdir /app
WORKDIR /app
# copy the project and restore as distinct layers in the image
COPY src/*.csproj ./
RUN dotnet restore
# copy the rest and build
COPY src/ ./
RUN dotnet build
RUN dotnet publish --runtime alpine-x64 -c Release -o out --self-contained true /p:PublishTrimmed=true
# build runtime image with DoD CA Certificates
FROM cingulara/openrmf-base:1.12.00
RUN apk update && apk upgrade
RUN mkdir /app
WORKDIR /app
COPY --from=build-env /app/out .
# Fix for broken build on Docker in GH is to put RUN true between multiple COPY statements :(
RUN true
# Create a group and user
RUN addgroup --system --gid 1001 cingularagroup \
&& adduser --system -u 1001 --ingroup cingularagroup --shell /bin/sh cingularauser
RUN chown -R cingularauser:cingularagroup /app
USER 1001
ENTRYPOINT ["./nats-client-metrics"]
LABEL org.opencontainers.image.source https://github.com/Cingulara/nats-client-metrics
LABEL maintainer="[email protected]"