github.com/dim4egster/coreth@v0.10.2/Dockerfile (about)

     1  # ============= Compilation Stage ================
     2  FROM golang:1.18.5-buster AS builder
     3  
     4  RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64
     5  
     6  ARG AVALANCHE_VERSION
     7  
     8  RUN mkdir -p $GOPATH/src/github.com/dim4egster
     9  WORKDIR $GOPATH/src/github.com/dim4egster
    10  
    11  RUN git clone -b $AVALANCHE_VERSION --single-branch https://github.com/dim4egster/qmallgo.git
    12  
    13  # Copy coreth repo into desired location
    14  COPY . coreth
    15  
    16  # Set the workdir to AvalancheGo and update coreth dependency to local version
    17  WORKDIR $GOPATH/src/github.com/dim4egster/qmallgo
    18  # Run go mod download here to improve caching of AvalancheGo specific depednencies
    19  RUN go mod download
    20  # Replace the coreth dependency
    21  RUN go mod edit -replace github.com/dim4egster/coreth=../coreth
    22  RUN go mod download && go mod tidy -compat=1.18
    23  
    24  # Build the AvalancheGo binary with local version of coreth.
    25  RUN ./scripts/build_avalanche.sh
    26  # Create the plugins directory in the standard location so the build directory will be recognized
    27  # as valid.
    28  RUN mkdir build/plugins
    29  
    30  # ============= Cleanup Stage ================
    31  FROM debian:11-slim AS execution
    32  
    33  # Maintain compatibility with previous images
    34  RUN mkdir -p /qmallgo/build
    35  WORKDIR /qmallgo/build
    36  
    37  # Copy the executables into the container
    38  COPY --from=builder /go/src/github.com/dim4egster/qmallgo/build .
    39  
    40  CMD [ "./qmallgo" ]