Dockerfile 846 B

123456789101112131415161718192021222324252627
  1. FROM golang:1.21 as builder
  2. # Define a build argument with an empty default value
  3. ARG CUSTOM_GOPROXY=""
  4. # Set the GOPROXY environment variable, using the specified value if provided, or a default if not
  5. ENV GOPROXY=${CUSTOM_GOPROXY:-https://proxy.golang.org}
  6. RUN go install gotest.tools/gotestsum@v1.12.0
  7. # Set the Current Working Directory inside the container
  8. WORKDIR /milvus
  9. # Copy go mod and sum files
  10. COPY client/go.mod client/go.mod
  11. COPY client/go.sum client/go.sum
  12. COPY tests/go_client/go.mod tests/go_client/
  13. COPY tests/go_client/go.sum tests/go_client/
  14. # Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
  15. RUN cd tests/go_client && go mod download
  16. # Copy the source code into the container
  17. COPY client client
  18. COPY tests/go_client tests/go_client
  19. WORKDIR /milvus/tests/go_client