-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (39 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
49 lines (39 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Multi-stage Dockerfile for Neo Smart Contract Compiler (nccs)
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /source
# Copy solution and project files
COPY *.sln .
COPY src/ ./src/
COPY tests/ ./tests/
COPY neo/ ./neo/
# Restore dependencies
RUN dotnet restore
# Build the compiler
RUN dotnet build src/Neo.Compiler.CSharp/Neo.Compiler.CSharp.csproj -c Release
# Publish self-contained executable
RUN dotnet publish src/Neo.Compiler.CSharp/Neo.Compiler.CSharp.csproj \
-c Release \
-r linux-x64 \
--self-contained true \
/p:PublishSingleFile=true \
/p:PublishReadyToRun=true \
-o /app
# Runtime stage
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0
WORKDIR /workspace
# Install additional tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
make \
&& rm -rf /var/lib/apt/lists/*
# Copy the compiled binary from build stage
COPY --from=build /app/nccs /usr/local/bin/nccs
RUN chmod +x /usr/local/bin/nccs
# Set up working directory
VOLUME ["/workspace"]
# Default command
CMD ["/bin/bash"]