Dockerfiles for win and linux containers

This commit is contained in:
etomas 2017-02-24 18:07:52 +01:00
Родитель 5b97c7329b
Коммит 79615664cf
22 изменённых файлов: 97 добавлений и 108 удалений

10
.gitignore поставляемый
Просмотреть файл

@ -254,3 +254,13 @@ pub/
/src/Web/WebMVC/Properties/PublishProfiles/eShopOnContainersWebMVC2016 - Web Deploy-publish.ps1
/src/Web/WebMVC/Properties/PublishProfiles/publish-module.psm1
/src/Services/Identity/eShopOnContainers.Identity/Properties/launchSettings.json
#docker-compose files are copied from nanowin or linux folders, so we need to ignore them
docker-compose.override.yml
docker-compose.vs.debug.yml
docker-compose.vs.release.yml
docker-compose.yml
docker-compose-external.override.yml
docker-compose-external.yml
#Same with Dockerfiles
/**/Dockerfile

Просмотреть файл

@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:

Просмотреть файл

@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:
basket.api:
@ -14,7 +14,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
catalog.api:
image: eshop/catalog.api:dev
@ -29,7 +29,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
identity.api:
image: eshop/identity.api:dev
@ -44,7 +44,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
ordering.api:
image: eshop/ordering.api:dev
@ -59,7 +59,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
webspa:
image: eshop/webspa:dev
@ -74,7 +74,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
webmvc:
image: eshop/webmvc:dev
@ -89,4 +89,4 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"

Просмотреть файл

@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:
basket.api:
@ -9,7 +9,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
catalog.api:
build:
@ -19,7 +19,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
identity.api:
build:
@ -29,7 +29,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
ordering.api:
build:
@ -39,7 +39,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
webspa:
build:
@ -49,7 +49,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
webmvc:
build:
@ -59,4 +59,4 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"

Просмотреть файл

@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:
basket.api:
@ -55,9 +55,17 @@ services:
- basket.api
sql.data:
image: microsoft/mssql-server-linux
image: microsoft/mssql-server-windows
basket.data:
image: redis
image: eshop/redis
build:
context: ./extradf
dockerfile: Dockerfile
ports:
- "6379:6379"
- "6379:6379"
networks:
default:
external:
name: nat

Просмотреть файл

@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:

Просмотреть файл

@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:
basket.api:
@ -14,7 +14,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
catalog.api:
image: eshop/catalog.api:dev
@ -29,7 +29,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
identity.api:
image: eshop/identity.api:dev
@ -44,7 +44,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
ordering.api:
image: eshop/ordering.api:dev
@ -59,7 +59,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
webspa:
image: eshop/webspa:dev
@ -74,7 +74,7 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"
webmvc:
image: eshop/webmvc:dev
@ -89,4 +89,4 @@ services:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
- "com.microsoft.visualstudio.targetoperatingsystem=windows"

Просмотреть файл

@ -1,62 +0,0 @@
version: '2'
services:
basket.api:
build:
args:
source: ${DOCKER_BUILD_SOURCE}
volumes:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
catalog.api:
build:
args:
source: ${DOCKER_BUILD_SOURCE}
volumes:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
identity.api:
build:
args:
source: ${DOCKER_BUILD_SOURCE}
volumes:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
ordering.api:
build:
args:
source: ${DOCKER_BUILD_SOURCE}
volumes:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
webspa:
build:
args:
source: ${DOCKER_BUILD_SOURCE}
volumes:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
webmvc:
build:
args:
source: ${DOCKER_BUILD_SOURCE}
volumes:
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"

Просмотреть файл

@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:
basket.api:
@ -55,9 +55,17 @@ services:
- basket.api
sql.data:
image: microsoft/mssql-server-linux
image: microsoft/mssql-server-windows
basket.data:
image: redis
image: eshop/redis
build:
context: ./extradf
dockerfile: Dockerfile
ports:
- "6379:6379"
- "6379:6379"
networks:
default:
external:
name: nat

Просмотреть файл

@ -1,10 +1,34 @@
Param([ValidateSet(nanowin", "linux")] [String] [Parameter(Mandatory=$true)] $Platform)
Param(
[ValidateSet(nanowin", "linux")] [String] [Parameter(Mandatory=$true)] $Platform,
[bool] $DeleteImages = $false
)
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
$SourcePerPlatformDockerFilesPath = "$ScriptPath\_docker\$Platform\extradf"
$TargetPerPlatformDockerFilesPath = "$ScriptPath\extradf"
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
Write-Host "Deleting eShop Docker images"
& "$ScriptPath\delete-images.ps1"
If ($DeleteImages) {
Write-Host "Deleting eShop Docker images"
& "$ScriptPath\delete-images.ps1"
}
If (Test-Path $TargetPerPlatformDockerFilesPath) {
Write-Host "Found per-platform extra Docker files. Removing..."
Remove-Item "$TargetPerPlatformDockerFilesPath\" -Recurse -Force
}
If (Test-Path $SourcePerPlatformDockerFilesPath) {
Write-Host "Copying per-platform extra Dockerfiles"
Copy-Item "$SourcePerPlatformDockerFilesPath\*" "$ScriptPath\extradf\" -Recurse -Force
}
else {
Write-Host "There are not extra Dockerfiles for platform $Platform"
}
Write-Host "Changing Dockerfiles"
Copy-Item "$ScriptPath\src\Services\Basket\Basket.API\Dockerfile.$Platform" "$ScriptPath\src\Services\Basket\Basket.API\Dockerfile" -Force
@ -17,4 +41,5 @@ Copy-Item "$ScriptPath\src\Web\WebSPA\Dockerfile.$Platform" "$ScriptPath\src\We
Write-Host "Replacing Docker-compose"
Copy-Item "$ScriptPath\_docker\$Platform\*.yml" "$ScriptPath\" -Force
Write-Host "Done. Docker files are set for platform: $Platform"

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80

Просмотреть файл

@ -1,4 +1,4 @@
FROM microsoft/aspnetcore:1.1
FROM microsoft/dotnet:1.1-runtime-nanoserver
ARG source
WORKDIR /app
EXPOSE 80