github.com/ava-labs/avalanchego@v1.11.11/vms/example/xsvm/Dockerfile (about)

     1  # The version is supplied as a build argument rather than hard-coded
     2  # to minimize the cost of version changes.
     3  ARG GO_VERSION
     4  
     5  # AVALANCHEGO_NODE_IMAGE needs to identify an existing node image and should include the tag
     6  ARG AVALANCHEGO_NODE_IMAGE
     7  
     8  # ============= Compilation Stage ================
     9  FROM golang:$GO_VERSION-bullseye AS builder
    10  
    11  WORKDIR /build
    12  
    13  # Copy and download avalanche dependencies using go mod
    14  COPY go.mod .
    15  COPY go.sum .
    16  RUN go mod download
    17  
    18  # Copy the code into the container
    19  COPY . .
    20  
    21  # Build xsvm
    22  RUN ./scripts/build_xsvm.sh
    23  
    24  # ============= Cleanup Stage ================
    25  FROM $AVALANCHEGO_NODE_IMAGE AS execution
    26  
    27  # Copy the xsvm binary to the default plugin path
    28  RUN mkdir -p /root/.avalanchego/plugins
    29  COPY --from=builder /build/build/xsvm /root/.avalanchego/plugins/v3m4wPxaHpvGr8qfMeyK6PRW3idZrPHmYcMTt7oXdK47yurVH
    30  
    31  # The node image's entrypoint will be reused.