Skip to content

Commit 97bae52

Browse files
committed
Update docker build
1 parent 33881b8 commit 97bae52

File tree

8 files changed

+56
-12
lines changed

8 files changed

+56
-12
lines changed

.dockerignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
**/bin/
2+
**/obj/
3+
**/global.json
4+
**/Dockerfile*
5+
**/.dockerignore*
6+
**/*.user
7+
**/*.Custom.json
8+
**/*.CustomDotSettings
9+
.idea/
10+
.vs/
11+
.vscode/
12+
.git/
13+
adr/
14+
artifacts/
15+
temp/
16+
**/_NCrunch_*

.editorconfig

Whitespace-only changes.

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ BenchmarkDotNet.Artifacts/
5757
# .NET Core
5858
project.lock.json
5959
project.fragment.lock.json
60-
artifacts/
6160

6261
# StyleCop
6362
StyleCopReport.xml

artifacts/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

build.cmd

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
@ECHO OFF
22

3-
docker run --rm -it --name hosting-build ^
3+
:: Builds the build environment image.
4+
docker build ^
5+
-f build.dockerfile ^
6+
--tag dotnet-libs-build .
7+
8+
if errorlevel 1 (
9+
echo Docker build failed: Exit code is %errorlevel%
10+
exit /b %errorlevel%
11+
)
12+
13+
docker run --rm -it --name dotnet-libs-build ^
414
-v /var/run/docker.sock:/var/run/docker.sock ^
5-
-v %cd%:/repo ^
6-
-w /repo ^
7-
-e FEEDZ_LOGICALITY_API_KEY=%FEEDZ_LOGICALITY_API_KEY% ^
8-
--network host ^
15+
-v %cd%/artifacts:/repo/artifacts ^
16+
-v %cd%/.git:/repo/.git ^
17+
-v %cd%/temp:/repo/temp ^
18+
-e NUGET_PACKAGES=/repo/temp/nuget-packages ^
919
-e BUILD_NUMBER=%GITHUB_RUN_NUMBER% ^
10-
damianh/dotnet-sdks:6 ^
11-
dotnet run -p build/build.csproj -c Release -- %*
20+
--network host ^
21+
dotnet-libs-build ^
22+
dotnet run -p build/Build.csproj -c Release -- %*
1223

1324
if errorlevel 1 (
1425
echo Docker build failed: Exit code is %errorlevel%

build.dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM damianh/dotnet-sdks:6
2+
3+
COPY . ./repo/
4+
5+
WORKDIR /repo

build.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
set -e
44

5+
docker build \
6+
-f build.dockerfile \
7+
--tag dotnet-libs-build .
8+
59
docker run --rm --name hosting-build \
610
-v /var/run/docker.sock:/var/run/docker.sock \
7-
-v $PWD:/repo \
8-
-w /repo \
9-
-e FEEDZ_LOGICALITY_API_KEY=$FEEDZ_LOGICALITY_API_KEY \
11+
-v $PWD/artifacts:/repo/artifacts \
12+
-v $PWD/.git:/repo/.git \
13+
-v $PWD/temp:/repo/temp \
14+
-e NUGET_PACKAGES=/repo/temp/nuget-packages \
1015
-e BUILD_NUMBER=$GITHUB_RUN_NUMBER \
1116
--network host \
12-
damianh/dotnet-sdks:6 \
17+
dotnet-libs-build \
1318
dotnet run -p build/Build.csproj -c Release -- "$@"

temp/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

0 commit comments

Comments
 (0)