Skip to content

Commit 5db7b7c

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] [CONFIG] [Docker] lint stage bugfix:
- new previous "init" stage. Now "base" install dependencies. - "lint" stage fixes.
1 parent b36d909 commit 5db7b7c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Dockerfile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
###############################################################################
2-
FROM mcr.microsoft.com/dotnet/sdk:8.0.302-1-alpine3.19-amd64 AS base
2+
FROM mcr.microsoft.com/dotnet/sdk:8.0.302-1-alpine3.19-amd64 AS init
33

44
ENV WORKDIR=/app
55
WORKDIR ${WORKDIR}
66

77
RUN apk add --update --no-cache make
88

9+
###############################################################################
10+
FROM init AS base
11+
12+
ENV WORKDIR=/app
13+
WORKDIR ${WORKDIR}
14+
15+
COPY ./Makefile ${WORKDIR}/
16+
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
17+
COPY ./algorithm-exercises-csharp/algorithm-exercises-csharp.csproj ${WORKDIR}/algorithm-exercises-csharp/algorithm-exercises-csharp.csproj
18+
COPY ./algorithm-exercises-csharp-base/algorithm-exercises-csharp-base.csproj ${WORKDIR}/algorithm-exercises-csharp-base/algorithm-exercises-csharp-base.csproj
19+
COPY ./algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj ${WORKDIR}/algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj
20+
21+
RUN make dependencies
22+
923
###############################################################################
1024
FROM base AS lint
1125

@@ -35,7 +49,6 @@ COPY ./algorithm-exercises-csharp ${WORKDIR}/algorithm-exercises-csharp
3549
COPY ./algorithm-exercises-csharp-base ${WORKDIR}/algorithm-exercises-csharp-base
3650
COPY ./algorithm-exercises-csharp-test ${WORKDIR}/algorithm-exercises-csharp-test
3751
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
38-
COPY ./Makefile ${WORKDIR}/
3952

4053
# code linting conf
4154
COPY ./.editorconfig ${WORKDIR}/
@@ -56,7 +69,6 @@ COPY ./algorithm-exercises-csharp ${WORKDIR}/algorithm-exercises-csharp
5669
COPY ./algorithm-exercises-csharp-base ${WORKDIR}/algorithm-exercises-csharp-base
5770
COPY ./algorithm-exercises-csharp-test ${WORKDIR}/algorithm-exercises-csharp-test
5871
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
59-
COPY ./Makefile ${WORKDIR}/
6072

6173
RUN make build
6274
RUN ls -alh

0 commit comments

Comments
 (0)