backtrack5r3
backtrack5r3
CC#
Created by backtrack5r3 on 7/19/2023 in #help
❔ Exception while using .BindConfiguration instead of .Configure
Hi, someon can up ? thanks !
4 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
When I try to use this in my Docker-compose :
command: "-- args1 args2 args3"
command: "-- args1 args2 args3"
According to ms doc https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-run#options I have these logs in my container :
==> /dev/null <==
tail: cannot open 'args1' for reading: No such file or directory
tail: cannot open 'args2' for reading: No such file or directory
tail: cannot open 'args3' for reading: No such file or directory
==> /dev/null <==
tail: cannot open 'args1' for reading: No such file or directory
tail: cannot open 'args2' for reading: No such file or directory
tail: cannot open 'args3' for reading: No such file or directory
very weird....
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
it seems like vs22 is doing more thing than we thought
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
Do you have a better way to advise me ?
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
so i am wrong and even running the Docker container alone, I need to rebuild the Dockerfile If I change the value inside my launchSettings.json ?
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
it's basically a launch option for the project
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
launchSettings.json
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
maybe I am wrong, but the commandLineArgs seems to create the container with passing args ex :
docker run myfile args1 args2 args3
docker run myfile args1 args2 args3
and I dont need to rebuild my dockerfile each time ?
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
i would like to not rebuild my dockerfile each time I change the args value, just recreate the container with the right args
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
i am trying to pass "args1", "args2", "args3" while running my console app from a docker-compose via the compose file
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
The weird things is that with launchProfiles and the Docker container launched alone the args are working well with the instruction :
"commandLineArgs": "args1 args2 args3",
"commandLineArgs": "args1 args2 args3",
But I cant figure out how to make the equivalent instruction for my docker-compose file
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["ConsoleApp/Console.csproj", "Console/"]
COPY ["ConsoleCore/Core.csproj", "Core/"]
COPY ["ConsoleInfrastructure/Infrastructure.csproj", "Infrastructure/"]
COPY ["ConsoleMock/Mock.csproj", "Mock/"]
RUN dotnet restore "ConsoleApp/Console.csproj"
COPY . .
WORKDIR "/src/ConsoleApp"
RUN dotnet build "Console.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Console.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Console.dll"]
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["ConsoleApp/Console.csproj", "Console/"]
COPY ["ConsoleCore/Core.csproj", "Core/"]
COPY ["ConsoleInfrastructure/Infrastructure.csproj", "Infrastructure/"]
COPY ["ConsoleMock/Mock.csproj", "Mock/"]
RUN dotnet restore "ConsoleApp/Console.csproj"
COPY . .
WORKDIR "/src/ConsoleApp"
RUN dotnet build "Console.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Console.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Console.dll"]
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
okay i'm on it
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
ENTRYPOINT ["dotnet", "MyDLL.dll"]
ENTRYPOINT ["dotnet", "MyDLL.dll"]
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
Yes
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
It's the default Dockerfile generated by visual studio
45 replies
CC#
Created by backtrack5r3 on 5/2/2023 in #help
❔ Get Console App args inside Docker container with Docker-compose
Sorry, When running locally I used these launchProfiles :
"profiles": {
"Development": {
"commandName": "Project",
"commandLineArgs": "args1 args2 args3",
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker",
"commandLineArgs": "args1 args2 args3"
}
}
"profiles": {
"Development": {
"commandName": "Project",
"commandLineArgs": "args1 args2 args3",
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker",
"commandLineArgs": "args1 args2 args3"
}
}
Both profiles are working well. But when I try to use the Docker inside à Docker-compose I dont success to retrieve args to my console app inside container. I tried inside Docker-compose :
command : ["args1", "args2", "args3"]
command : ["args1", "args2", "args3"]
I tried inside Dockerfile :
CMD ["args1", "args2", "args3"]
CMD ["args1", "args2", "args3"]
45 replies