Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit e8b664b

Browse files
committed
- docker image fixes
1 parent e25ee96 commit e8b664b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine3.15 AS build-env
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
22

33
ARG MS_NUGET_URL=https://nuget.pkg.github.com/microsoft/index.json
44
ARG MSGRAPH_NUGET_URL=https://nuget.pkg.github.com/microsoftgraph/index.json
@@ -9,21 +9,24 @@ WORKDIR /app
99

1010
COPY ./src ./msgraph-cli/src
1111
COPY ./msgraph-cli-core ./msgraph-cli/msgraph-cli-core
12-
RUN ls -al ./msgraph-cli/src/generated/DeviceManagement/ApplePushNotificationCertificate
1312
WORKDIR /app/msgraph-cli
1413

1514
RUN dotnet nuget add source ${MS_NUGET_URL} -n ms-gh -u ${NUGET_USER} -p ${NUGET_PASSWORD} --store-password-in-clear-text &&\
1615
dotnet nuget add source ${MSGRAPH_NUGET_URL} -n msgraph-gh -u ${NUGET_USER} -p ${NUGET_PASSWORD} --store-password-in-clear-text
1716

1817
RUN dotnet publish ./src/msgraph-cli.csproj --configuration Release --no-self-contained -p:PublishSingleFile=false -p:PublishReadyToRun=false
1918

20-
FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine3.15 as runtime
19+
FROM mcr.microsoft.com/dotnet/runtime:6.0 as runtime
20+
2121
WORKDIR /app
2222

23-
COPY --from=build-env /app/msgraph-cli/src/msgraph-cli/bin/Release/net6.0/publish ./
23+
COPY --from=build-env /app/msgraph-cli/src/bin/Release/net6.0/${RID}/ ./dist
24+
RUN echo 'export PATH=$PATH:/app/dist' > /app/.bash_profile
25+
26+
ENV HOME=/app
2427

25-
ENV HOME=/app/home
28+
# CMD ["bash", "-l"]
29+
ENTRYPOINT ["/app/dist/mgc"]
2630

27-
ENTRYPOINT ["dotnet", "mgc.dll"]
2831
LABEL description="# Welcome to the Microsoft Graph CLI \
2932
[Source dockerfile](https://github.com/microsoftgraph/msgraph-cli/blob/main/Dockerfile)"

src/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static IHostBuilder CreateHostBuilder(string[] args) =>
123123

124124
static void ConfigureAppConfiguration(IConfigurationBuilder builder) {
125125
builder.Sources.Clear();
126-
builder.AddJsonFile("app-settings.json", optional: false);
126+
builder.AddJsonFile(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "app-settings.json"), optional: false);
127127
var pathUtil = new PathUtility();
128128
var authCache = new AuthenticationCacheUtility(pathUtil);
129129
var dataDir = pathUtil.GetApplicationDataDirectory();

0 commit comments

Comments
 (0)