Build project in docker it self
It is more of a question then an issue. So, feel free to close it. And I m docker noob, so don't mind my queries. Didn't find better place to ask so asking here.
# Sample contents of Dockerfile
# Stage 1
FROM microsoft/aspnetcore-build AS builder
WORKDIR /source
# caches restore result by copying csproj file separately
COPY *.csproj .
RUN dotnet restore
# copies the rest of your code
COPY . .
RUN dotnet publish --output /app/ --configuration Release
# Stage 2
FROM microsoft/aspnetcore
WORKDIR /app
COPY --from=builder /app .
ENTRYPOINT ["dotnet", "myapp.dll"]
This snippet is from official aspnetcore build image. Can't we do similar thing with this project.
Stage1 to build & test and Stage 2 to run.
Question
- It will create two images or single image ?
- In case of two images what will happen to second image?
- In case of one image how can it will be two, one will
build and testand other willdeployed and run.
Again I apologise if question is totally out of context.
Yes, we could do build inside a docker - actually, that was the plan when I've been thinking about CirlceCI build, I need to get back to it.
The problem is that our docker image needs to be a bit more complex than simple ASP.Net Core one - we need to install node (for Fable parts), mono (Paket & FAKE), and .Net Core (well, that is also installed with FAKE script, so can be omitted in the image)
@Krzysztof-Cieslak I guess then mono image would be better. But anyways thanks for answer. 👍