1
0

Build docker-compose-generator multiarch Docker images

This commit is contained in:
rockstardev
2018-11-23 07:43:34 -06:00
parent 55f99575f8
commit 912a0bea46
4 changed files with 111 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
#
FROM microsoft/dotnet:2.1.500-sdk-alpine3.7 AS builder
WORKDIR /source
COPY src/docker-compose-generator.csproj docker-compose-generator.csproj
@@ -6,10 +7,11 @@ RUN dotnet restore
COPY src/. .
RUN dotnet publish --output /app/ --configuration Release
#
FROM microsoft/dotnet:2.1.6-runtime-alpine3.7
WORKDIR /app
WORKDIR /datadir
RUN mkdir /datadir
WORKDIR /app
ENV APP_DATADIR=/datadir
VOLUME /datadir

View File

@@ -0,0 +1,22 @@
# This is a manifest image, will pull the image with the same arch as the builder machine
FROM microsoft/dotnet:2.1.500-sdk AS builder
WORKDIR /source
COPY src/docker-compose-generator.csproj docker-compose-generator.csproj
# Cache some dependencies
RUN dotnet restore
COPY src/. .
RUN dotnet publish --output /app/ --configuration Release
# Force the builder machine to take make an arm runtime image. This is fine as long as the builder does not run any program
FROM microsoft/dotnet:2.1.6-aspnetcore-runtime-stretch-slim-arm32v7
WORKDIR /datadir
WORKDIR /app
ENV APP_DATADIR=/datadir
VOLUME /datadir
ENV INSIDE_CONTAINER=1
COPY --from=builder "/app" .
ENTRYPOINT ["dotnet", "docker-compose-generator.dll"]

View File

@@ -3,7 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docker-compose-generator", "src/docker-compose-generator.csproj", "{0900AF35-48E8-46E2-85B3-BA3847EE0844}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "docker-compose-generator", "src\docker-compose-generator.csproj", "{0900AF35-48E8-46E2-85B3-BA3847EE0844}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{8C1C711D-DEF1-474C-A9F6-AAE142412528}"
ProjectSection(SolutionItems) = preProject
..\.circleci\config.yml = ..\.circleci\config.yml
Dockerfile.linuxamd64 = Dockerfile.linuxamd64
Dockerfile.linuxarm32v7 = Dockerfile.linuxarm32v7
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -14,9 +21,6 @@ Global
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0900AF35-48E8-46E2-85B3-BA3847EE0844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0900AF35-48E8-46E2-85B3-BA3847EE0844}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -31,4 +35,10 @@ Global
{0900AF35-48E8-46E2-85B3-BA3847EE0844}.Release|x86.ActiveCfg = Release|Any CPU
{0900AF35-48E8-46E2-85B3-BA3847EE0844}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CADA76A8-7F2E-4132-900B-330F0D2D722B}
EndGlobalSection
EndGlobal