-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Dockerfile.cbl-mariner-x64 file and updating dockerfiles (#192)
* Updated Dockerfile with 8.0-jammy-chiseled for runtime, updated Dockerfile.nanoserver-x64 and Dockerfile.ubuntu by changing workdir for dotnet restore and build to match Dockerfile, added Dockerfile.cbl-mariner-x64 file * Removed -r parameter for Run dotnet publish command * added Dockerfile.chiseled file * updated dockerfiles adding ARG ARCH with default values enabling user to build containers targeting different architecture * Removed -r parameter from RUN dotnet publish command due to conflict with -a parameter * --platform parameter is added to all linux flavor dockerfiles * minor fix in Dockerfile * Added argument TAG to Dockerfile.nanoserver for enabling to build different versions of Windows nanoserver
- Loading branch information
Showing
6 changed files
with
73 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-cbl-mariner2.0 AS build | ||
ARG TARGETARCH | ||
|
||
WORKDIR /source | ||
|
||
# Copy files | ||
COPY . . | ||
WORKDIR /source/main/GarnetServer | ||
|
||
RUN dotnet restore -a $TARGETARCH | ||
RUN dotnet build -a $TARGETARCH -c Release | ||
|
||
# Copy and publish app and libraries | ||
RUN dotnet publish -a $TARGETARCH -c Release -o /app --self-contained false --no-restore -f net8.0 | ||
|
||
# Final stage/image | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0-cbl-mariner2.0 AS runtime | ||
|
||
WORKDIR /app | ||
COPY --from=build /app . | ||
|
||
# For inter-container communication. | ||
EXPOSE 6379 | ||
|
||
# Run GarnetServer with an index size of 128MB | ||
ENTRYPOINT ["/app/GarnetServer", "-i", "128m", "--port", "6379"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build | ||
ARG TARGETARCH | ||
|
||
WORKDIR /source | ||
|
||
# Copy files | ||
COPY . . | ||
WORKDIR /source/main/GarnetServer | ||
|
||
RUN dotnet restore -a $TARGETARCH | ||
RUN dotnet build -a $TARGETARCH -c Release | ||
|
||
# Copy and publish app and libraries | ||
RUN dotnet publish -a $TARGETARCH -c Release -o /app --self-contained false --no-restore -f net8.0 | ||
|
||
# Final stage/image | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled AS runtime | ||
|
||
WORKDIR /app | ||
COPY --from=build /app . | ||
|
||
# For inter-container communication. | ||
EXPOSE 6379 | ||
|
||
# Run GarnetServer with an index size of 128MB | ||
ENTRYPOINT ["/app/GarnetServer", "-i", "128m", "--port", "6379"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS build | ||
ARG TAG=ltsc2022 | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-$TAG AS build | ||
|
||
WORKDIR /source | ||
|
||
# Copy files | ||
COPY . . | ||
WORKDIR /source/main/GarnetServer | ||
|
||
RUN dotnet restore | ||
RUN dotnet build -c Release | ||
|
||
# Copy and publish app and libraries | ||
WORKDIR /source/main/GarnetServer | ||
RUN dotnet publish -c Release -o /app -r win-x64 --self-contained false -f net8.0 | ||
|
||
# Final stage/image | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS runtime | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-$TAG AS runtime | ||
WORKDIR /app | ||
COPY --from=build /app . | ||
|
||
# For inter-container communication. | ||
EXPOSE 6379 | ||
|
||
# Run GarnetServer with an index size of 128MB | ||
ENTRYPOINT ["/app/GarnetServer.exe", "-i", "128m", "--port", "6379"] | ||
ENTRYPOINT ["/app/GarnetServer.exe", "-i", "128m", "--port", "6379"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters