Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dockerfiles missing dotnet restore #288

Merged
merged 18 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build AasxServerBlazor
uses: docker/build-push-action@v6
with:
Expand All @@ -34,10 +34,6 @@ jobs:
file: ./src/docker/Dockerfile-AasxServerBlazor
tags: adminshellio/aasx-server-blazor:test

- name: Test AasxServerBlazor
run: |
docker run --rm adminshellio/aasx-server-blazor:test

- name: Build AasxServerBlazor-arm32
uses: docker/build-push-action@v6
with:
Expand All @@ -46,10 +42,6 @@ jobs:
file: ./src/docker/Dockerfile-AasxServerBlazor-arm32
tags: adminshellio/aasx-server-blazor-arm32:test

- name: Test AasxServerBlazor-arm32
run: |
docker run --rm adminshellio/aasx-server-blazor-arm32:test

- name: Build AasxServerBlazor-arm64
uses: docker/build-push-action@v6
with:
Expand All @@ -58,10 +50,6 @@ jobs:
file: ./src/docker/Dockerfile-AasxServerBlazor-arm64
tags: adminshellio/aasx-server-blazor-arm64:test

- name: Test AasxServerBlazor-arm64
run: |
docker run --rm adminshellio/aasx-server-blazor-arm64:test

- name: Build AasxServerCore
uses: docker/build-push-action@v6
with:
Expand All @@ -70,10 +58,6 @@ jobs:
file: ./src/docker/Dockerfile-AasxServerAspNetCore
tags: adminshellio/aasx-server-core:test

- name: Test AasxServerAspNetCore
run: |
docker run --rm adminshellio/aasx-server-core:test

- name: Build AasxServerCore-arm32
uses: docker/build-push-action@v6
with:
Expand All @@ -82,22 +66,14 @@ jobs:
file: ./src/docker/Dockerfile-AasxServerAspNetCore-arm32
tags: adminshellio/aasx-server-core-arm32:test

- name: Test AasxServerAspNetCore-arm32
run: |
docker run --rm adminshellio/aasx-server-core-arm32:test

- name: Build AasxServerCore-arm64
uses: docker/build-push-action@v6
with:
push: false
load: true
file: ./src/docker/Dockerfile-AasxServerAspNetCore-arm64
tags: adminshellio/aasx-server-core-arm64:test

- name: Test AasxServerAspNetCore-arm64
run: |
docker run --rm adminshellio/aasx-server-core-arm64:test


check-release:
runs-on: windows-latest
name: Check that the whole project is buildable and attach packages to process
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/prerelease-on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,39 +258,39 @@ jobs:
id: set-version
run: echo "VERSION_NUMBER=$(echo ${{ needs.create-new-prerelease.outputs.VERSION_NUMBER }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and publish AasxServerBlazor
uses: docker/build-push-action@v6
with:
push: true
load: true
file: ./src/docker/Dockerfile-AasxServerBlazor
tags: "${{ env.VERSION_NUMBER }}"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and publish AasxServerBlazor-arm32
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/arm32
context: ./src/docker/
file: Dockerfile-AasxServerBlazor-arm32
load: true
file: ./src/docker/Dockerfile-AasxServerBlazor-arm32
tags: adminshellio/AasxServerBlazor-arm32:${{ env.VERSION_NUMBER }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and publish AasxServerBlazor-arm64
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/arm64
load: true
file: ./src/docker/Dockerfile-AasxServerBlazor-arm64
tags: "${{ env.VERSION_NUMBER }}"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and publish AasxServerBlazor
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64
file: ./src/docker/Dockerfile-AasxServerBlazor
tags: "${{ env.VERSION_NUMBER }}"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and publish AasxServerCore
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64
load: true
file: ./src/docker/Dockerfile-AasxServerAspNetCore
tags: "${{ env.VERSION_NUMBER }}"
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -299,7 +299,7 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/arm32
load: true
file: ./src/docker/Dockerfile-AasxServerAspNetCore-arm32
tags: "${{ env.VERSION_NUMBER }}"
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -308,7 +308,7 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/arm64
load: true
file: ./src/docker/Dockerfile-AasxServerAspNetCore-arm64
tags: "${{ env.VERSION_NUMBER }}"
github-token: ${{ secrets.GITHUB_TOKEN }}"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactored ServerConfiguration.cs into smaller parts and applying Clean code and SOLID principles. (@Freezor)
- Applied general fixes in naming, layout, and applied Resharper suggestions across the AasxServerBlazor project to adhere to best practices and enhance future
maintainability. (@Freezor)
- Changed TargetFramework from Net6.0 to Net8.0 because of library issues and not runnable docker images. (@Freezor)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ csharp_space_within_array_access_brackets = false
# If you use StyleCop, you'll need to disable SA1636: File header copyright text should match.
# dotnet_diagnostic.SA1636.severity = none
# Undocumented
dotnet_style_operator_placement_when_wrapping = end_of_line:warning
dotnet_style_operator_placement_when_wrapping = end_of_line
csharp_style_prefer_null_check_over_type_check = true:warning

# C# Style Rules
Expand Down
2 changes: 1 addition & 1 deletion src/AasCore.Aas3_0/AasCore.Aas3_0.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;DebugSlow</Configurations>
<Platforms>AnyCPU</Platforms>
Expand Down
2 changes: 1 addition & 1 deletion src/AasSecurity/AasSecurity.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.3.0.1-aasV3-alpha-latest</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2322,8 +2322,6 @@ public byte[] ComputeByteArray()
bs = BitConverter.GetBytes((float) o);
else if (o is char)
bs = BitConverter.GetBytes((char) o);
else if (o is byte)
bs = BitConverter.GetBytes((byte) o);
else if (o is int)
bs = BitConverter.GetBytes((int) o);
else if (o is long)
Expand Down
2 changes: 1 addition & 1 deletion src/AasxCsharpLibrary/AasxCsharpLibrary.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>AdminShellNS</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand Down
3 changes: 2 additions & 1 deletion src/AasxServerAspNetCore/AasxServerAspNetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.3.0.1-aasV3-alpha-latest</Version>
<RuntimeIdentifiers>linux-arm;linux-arm64;win-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
Expand Down
3 changes: 2 additions & 1 deletion src/AasxServerBlazor/AasxServerBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<SatelliteResourceLanguages>en-US;de-DE</SatelliteResourceLanguages>
<Version>0.3.0.1-aasV3-alpha-latest</Version>
<RuntimeIdentifiers>linux-arm;linux-arm64;win-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 1 addition & 1 deletion src/AasxServerDB/AasxServerDB.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AasxServerStandardBib/AasxServerStandardBib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!--<TargetFramework>netstandard2.0</TargetFramework>-->
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<SatelliteResourceLanguages>en-US;de-DE</SatelliteResourceLanguages>
<UserSecretsId>ef550880-6a5f-4e0c-b634-8284f1dc5445</UserSecretsId>
<Version>0.3.0.1-aasV3-alpha-latest</Version>
Expand Down
2 changes: 1 addition & 1 deletion src/DataTransferObjects/DataTransferObjects.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.3.0.1-aasV3-alpha-latest</Version>
Expand Down
2 changes: 1 addition & 1 deletion src/ExampleClient/ExampleClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IO.Swagger.Lib.V3/IO.Swagger.Lib.V3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>IO.Swagger</Description>
<Copyright>IO.Swagger</Copyright>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>IO.Swagger.Lib.V3</AssemblyName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>IO.Swagger</Description>
<Copyright>IO.Swagger</Copyright>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>IO.Swagger.Registry.Lib.V3</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/current_version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.3.1
6 changes: 4 additions & 2 deletions src/docker/Dockerfile-AasxServerAspNetCore
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# It is expected that this docker is executed in the context of repository root.
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /repo/src

# Copy the source code and build
COPY ./src/ /repo/src/
COPY ./LICENSE.TXT /repo/LICENSE.txt

RUN dotnet restore AasxServerAspNetCore
RUN dotnet publish -c Release -o /out/AasxServerAspNetCore AasxServerAspNetCore

FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0 as base
EXPOSE 5001
COPY --from=build-env /out/AasxServerAspNetCore/ /AasxServerAspNetCore/
COPY ./content-for-demo/ /AasxServerAspNetCore/
Expand Down
5 changes: 3 additions & 2 deletions src/docker/Dockerfile-AasxServerAspNetCore-arm32
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Based on https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile.debian-arm32
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /repo/src

# Copy everything else and build
Expand All @@ -8,9 +8,10 @@ COPY ./LICENSE.TXT /repo/LICENSE.txt

#RUN dotnet restore -r linux-arm

RUN dotnet restore AasxServerAspNetCore
RUN dotnet publish -c Release -o /out/AasxServerAspNetCore AasxServerAspNetCore -r linux-arm --self-contained false

FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim-arm32v7
FROM mcr.microsoft.com/dotnet/aspnet:8.0.3-bookworm-slim-arm32v7 as base
EXPOSE 5001
COPY --from=build-env /out/AasxServerAspNetCore/ /AasxServerAspNetCore/
COPY ./content-for-demo/ /AasxServerAspNetCore/
Expand Down
5 changes: 3 additions & 2 deletions src/docker/Dockerfile-AasxServerAspNetCore-arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Based on https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile.debian-arm32
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /repo/src

# Copy everything else and build
Expand All @@ -8,9 +8,10 @@ COPY ./LICENSE.TXT /repo/LICENSE.txt

#RUN dotnet restore -r linux-arm64

RUN dotnet restore AasxServerAspNetCore
RUN dotnet publish -c Release -o /out/AasxServerAspNetCore AasxServerAspNetCore -r linux-arm64 --self-contained false

FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim-arm64v8
FROM mcr.microsoft.com/dotnet/aspnet:8.0 as base
EXPOSE 5001
COPY --from=build-env /out/AasxServerAspNetCore/ /AasxServerAspNetCore/
COPY ./content-for-demo/ /AasxServerAspNetCore/
Expand Down
10 changes: 7 additions & 3 deletions src/docker/Dockerfile-AasxServerBlazor
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# It is expected that this docker is executed in the context of repository root.
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /repo/src

# Copy everything else and build
COPY ./src/ /repo/src/
COPY ./LICENSE.TXT /repo/LICENSE.txt
RUN dotnet publish -c Release -o /out/AasxServerBlazor AasxServerBlazor

FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base
RUN dotnet clean
RUN dotnet restore
RUN dotnet build -o /out/AasxServerBlazor AasxServerBlazor -v diag
RUN dotnet publish -c Release -v diag --no-restore

FROM mcr.microsoft.com/dotnet/aspnet:8.0 as base
RUN apt update && apt upgrade --yes
RUN apt install -y curl nano libgdiplus
EXPOSE 5001
Expand Down
7 changes: 4 additions & 3 deletions src/docker/Dockerfile-AasxServerBlazor-arm32
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Based on https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile.debian-arm32
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /repo/src

# Copy everything else and build
COPY ./src/ /repo/src/
COPY ./LICENSE.TXT /repo/LICENSE.txt

RUN dotnet clean
RUN dotnet restore -r linux-arm

RUN dotnet restore AasxServerBlazor
RUN dotnet publish -c Release -o /out/AasxServerBlazor AasxServerBlazor -r linux-arm --self-contained false --no-restore

FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim-arm32v7 as base
FROM mcr.microsoft.com/dotnet/aspnet:8.0.3-bookworm-slim-arm32v7 as base
# RUN apt-get update && apt-get install -y libgdiplus
EXPOSE 5001
COPY --from=build-env /out/AasxServerBlazor/ /AasxServerBlazor/
Expand Down
Loading
Loading