File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change 11#  syntax=docker/dockerfile:1
22
33#  Base image and static SDK have to be updated together.
4- FROM  --platform=$BUILDPLATFORM  swift:6.1 AS builder
4+ FROM  swift:6.1 AS builder
55WORKDIR  /workspace
66
77#  Install Swift static SDK for better portability
@@ -12,21 +12,9 @@ RUN swift sdk install \
1212#  Copy source files
1313COPY  . /workspace
1414
15- #  Build with static SDK and cross-compilation support
16- ARG  TARGETPLATFORM
17- RUN  --mount=type=cache,target=/workspace/.build,id=build-$TARGETPLATFORM \
18-     echo "Building for platform: $TARGETPLATFORM"  && \
19-     swift sdk list && \
20-     case "$TARGETPLATFORM"  in \
21-       "linux/amd64" ) \
22-         swift build -c release --swift-sdk swift-6.1-RELEASE_static-linux-0.0.1 && \
23-         cp /workspace/.build/*/release/subtree /workspace/subtree ;; \
24-       "linux/arm64" ) \
25-         swift build -c release --swift-sdk swift-6.1-RELEASE_static-linux-0.0.1 && \
26-         cp /workspace/.build/*/release/subtree /workspace/subtree ;; \
27-       *) \
28-         echo "Unsupported platform: $TARGETPLATFORM"  && exit 1 ;; \
29-     esac
15+ #  Build with static SDK using native compilation
16+ RUN  swift build -c release --swift-sdk swift-6.1-RELEASE_static-linux-0.0.1 && \
17+     find /workspace/.build -name "subtree"  -type f -executable -exec cp {} /workspace/subtree \; 
3018
3119#  Final minimal runtime image
3220FROM  scratch AS runner
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments