Skip to content

Commit

Permalink
.docker: Adapt NeoC# Dockerfile for ARM-based Mac
Browse files Browse the repository at this point in the history
Publishing dotnet with -r linux-x64 is unavailable on ARM base
architecture.

Close #162

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Apr 26, 2024
1 parent 7c1946a commit aec270b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .docker/build/Dockerfile.sharp.sources.from_binaries
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN set -x \
unzip \
wget

# Publish neo-cli from source as a self-contained deployment for linux-64 into /neo-cli folder (all dependant .dlls are included).
# Publish neo-cli from source as a self-contained deployment into /neo-cli folder (all dependant .dlls are included).
# See https://docs.microsoft.com/ru-ru/dotnet/core/deploying/#publish-self-contained for details.
ENV CLIBRANCH="v3.6.0"
RUN wget -O /tmp/neo-cli.zip https://github.com/neo-project/neo-node/archive/${CLIBRANCH}.zip && \
Expand All @@ -17,7 +17,7 @@ RUN wget -O /tmp/neo-cli.zip https://github.com/neo-project/neo-node/archive/${C
cp -r tmp/neo-node/*/Neo.ConsoleService /build && \
cp tmp/neo-node/*/NuGet.Config /build/neo-cli && \
dotnet restore /build/neo-cli && \
dotnet publish -c Release --framework net7.0 -r linux-x64 /build/neo-cli -o /neo-cli && \
dotnet publish -c Release --framework net7.0 /build/neo-cli -o /neo-cli && \
rm -rf /build /tmp/neo-cli.zip /tmp/neo-node

# Build neo-modules from source into /Plugins folder (only plugin .dll and plugin config are included, if you need other dependant .dlls, see the next step)
Expand All @@ -42,21 +42,21 @@ RUN dotnet publish -c Release --framework net7.0 /tmp/neo-modules/*/src/RpcServe
cp /tmp/neo-modules/*/src/RocksDBStore/bin/Release/net7.0/publish/RocksDbSharp.dll /Plugins/ && \
rm -rf /tmp/neo-modules.zip /tmp/neo-modules

# Publish neo-vm from source as a self-contained deployment for linux-64 into /neo-vm folder (although neo-vm does not have dependant .dlls)
# Publish neo-vm from source as a self-contained deployment into /neo-vm folder (although neo-vm does not have dependant .dlls)
ENV NEOVMBRANCH="v3.6.0"
RUN wget -O /tmp/neo-vm.zip https://github.com/neo-project/neo-vm/archive/${NEOVMBRANCH}.zip && \
unzip -q -d /tmp/neo-vm/ /tmp/neo-vm.zip && \
ls -l /tmp/* && \
dotnet restore /tmp/neo-vm/*/src/Neo.VM/ && \
dotnet publish -c Release --framework net7.0 -r linux-x64 /tmp/neo-vm/*/src/Neo.VM/ -o /neo-vm && \
dotnet publish -c Release --framework net7.0 /tmp/neo-vm/*/src/Neo.VM/ -o /neo-vm && \
rm -rf /tmp/neo-vm.zip tmp/neo-vm

# Publish neo from source as a self-contained deployment for linux-64 into /neo folder (all dependant .dlls are included)
# Publish neo from source as a self-contained deployment into /neo folder (all dependant .dlls are included)
ENV NEOBRANCH="v3.6.0"
RUN wget -O /tmp/neo.zip https://github.com/neo-project/neo/archive/${NEOBRANCH}.zip && \
unzip -q -d /tmp/neo/ /tmp/neo.zip && \
dotnet restore /tmp/neo/*/src/Neo/ && \
dotnet publish -c Release --framework net7.0 -r linux-x64 /tmp/neo/*/src/Neo/ -o /neo && \
dotnet publish -c Release --framework net7.0 /tmp/neo/*/src/Neo/ -o /neo && \
rm -rf /tmp/neo.zip tmp/neo

# All things are published, so build the final image by copying binaries from Build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ RUN sed -i '/PackageReference Include="Neo" Version=/c \ <ProjectReference In
sed -i '/<PackageReference Include="Neo.VM" Version=/c \ <ProjectReference Include="..\\..\\..\\neo-vm\\src\\Neo.VM\\Neo.VM.csproj" \/>' /neo-project/neo/src/Neo/Neo.csproj && \
sed -i '/<PackageReference Include="Neo" Version=/c \ <ProjectReference Include="..\\..\\..\\neo\\src\\Neo\\Neo.csproj" \/>' /neo-project/neo-modules/src/Directory.Build.props

# Publish neo-cli from source as a self-contained deployment for linux-64 into /neo-cli folder (all dependant .dlls are included).
# Publish neo-cli from source as a self-contained deployment into /neo-cli folder (all dependant .dlls are included).
# See https://docs.microsoft.com/ru-ru/dotnet/core/deploying/#publish-self-contained for details.
RUN dotnet publish -c Release --framework net7.0 -r linux-x64 /neo-project/neo-node/neo-cli -o /neo-cli
RUN dotnet publish -c Release --framework net7.0 /neo-project/neo-node/neo-cli -o /neo-cli

# Build neo-modules from source into /Plugins folder (only plugin .dll and plugin config are included, if you need other dependant .dlls, see the next step)
RUN mkdir /Plugins && \
Expand Down

0 comments on commit aec270b

Please sign in to comment.