Skip to content

Commit 4dc5e65

Browse files
Add .dockerignore to sample (plus small tweaks to Dockerfile) (#32)
1 parent 85ee15e commit 4dc5e65

File tree

6 files changed

+83
-15
lines changed

6 files changed

+83
-15
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.dockerignore
2+
**/.env
3+
**/.git
4+
**/.gitignore
5+
**/.project
6+
**/.settings
7+
**/.toolstarget
8+
**/.vs
9+
**/.vscode
10+
**/.idea
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

samples/mysql/MySqlEndToEndPollingSample/Consumer/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ COPY ["Directory.Packages.props", "."]
1111
RUN dotnet restore "samples/mysql/MySqlEndToEndPollingSample/Consumer/Consumer.csproj"
1212
COPY . .
1313
WORKDIR "/code/samples/mysql/MySqlEndToEndPollingSample/Consumer"
14-
RUN dotnet build "Consumer.csproj" -c Release -o /app/build
15-
16-
FROM build AS publish
17-
RUN dotnet publish "Consumer.csproj" -c Release -o /app/publish
14+
RUN dotnet publish "Consumer.csproj" -c Release -o /app/publish # TODO figure out why --no-restore is not working
1815

1916
FROM base AS final
2017
WORKDIR /app
21-
COPY --from=publish /app/publish .
18+
COPY --from=build /app/publish .
2219
ENTRYPOINT ["dotnet", "Consumer.dll"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.dockerignore
2+
**/.env
3+
**/.git
4+
**/.gitignore
5+
**/.project
6+
**/.settings
7+
**/.toolstarget
8+
**/.vs
9+
**/.vscode
10+
**/.idea
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

samples/mysql/MySqlEndToEndPollingSample/OutOfProcessProducer/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ WORKDIR /code
88
COPY ["samples/mysql/MySqlEndToEndPollingSample/OutOfProcessProducer/OutOfProcessProducer.csproj", "samples/mysql/MySqlEndToEndPollingSample/OutOfProcessProducer/"]
99
COPY ["samples/mysql/MySqlEndToEndPollingSample/ProducerShared/ProducerShared.csproj", "samples/mysql/MySqlEndToEndPollingSample/ProducerShared/"]
1010
COPY ["src/Core/Core.csproj", "src/Core/"]
11+
COPY ["src/Core.OpenTelemetry/Core.OpenTelemetry.csproj", "src/Core.OpenTelemetry/"]
1112
COPY ["src/MySql/MySql.csproj", "src/MySql/"]
1213
COPY ["src/Directory.Build.props", "src/"]
1314
COPY ["Directory.Packages.props", "."]
1415
RUN dotnet restore "samples/mysql/MySqlEndToEndPollingSample/OutOfProcessProducer/OutOfProcessProducer.csproj"
1516
COPY . .
1617
WORKDIR "/code/samples/mysql/MySqlEndToEndPollingSample/OutOfProcessProducer"
17-
RUN dotnet build "OutOfProcessProducer.csproj" -c Release -o /app/build
18-
19-
FROM build AS publish
20-
RUN dotnet publish "OutOfProcessProducer.csproj" -c Release -o /app/publish
18+
RUN dotnet publish "OutOfProcessProducer.csproj" -c Release -o /app/publish # TODO figure out why --no-restore is not working
2119

2220
FROM base AS final
2321
WORKDIR /app
24-
COPY --from=publish /app/publish .
22+
COPY --from=build /app/publish .
2523
ENTRYPOINT ["dotnet", "OutOfProcessProducer.dll"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.dockerignore
2+
**/.env
3+
**/.git
4+
**/.gitignore
5+
**/.project
6+
**/.settings
7+
**/.toolstarget
8+
**/.vs
9+
**/.vscode
10+
**/.idea
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

samples/mysql/MySqlEndToEndPollingSample/Producer/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ WORKDIR /code
88
COPY ["samples/mysql/MySqlEndToEndPollingSample/Producer/Producer.csproj", "samples/mysql/MySqlEndToEndPollingSample/Producer/"]
99
COPY ["samples/mysql/MySqlEndToEndPollingSample/ProducerShared/ProducerShared.csproj", "samples/mysql/MySqlEndToEndPollingSample/ProducerShared/"]
1010
COPY ["src/Core/Core.csproj", "src/Core/"]
11+
COPY ["src/Core.OpenTelemetry/Core.OpenTelemetry.csproj", "src/Core.OpenTelemetry/"]
1112
COPY ["src/MySql/MySql.csproj", "src/MySql/"]
1213
COPY ["src/Directory.Build.props", "src/"]
1314
COPY ["Directory.Packages.props", "."]
1415
RUN dotnet restore "samples/mysql/MySqlEndToEndPollingSample/Producer/Producer.csproj"
1516
COPY . .
1617
WORKDIR "/code/samples/mysql/MySqlEndToEndPollingSample/Producer"
17-
RUN dotnet build "Producer.csproj" -c Release -o /app/build
18-
19-
FROM build AS publish
20-
RUN dotnet publish "Producer.csproj" -c Release -o /app/publish
18+
RUN dotnet publish "Producer.csproj" -c Release -o /app/publish # TODO figure out why --no-restore is not working
2119

2220
FROM base AS final
2321
WORKDIR /app
24-
COPY --from=publish /app/publish .
22+
COPY --from=build /app/publish .
2523
ENTRYPOINT ["dotnet", "Producer.dll"]

0 commit comments

Comments
 (0)