github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/deploy/prod/docker/single/Dockerfile (about)

     1  FROM golang:1.22 AS builder
     2  
     3  ARG mode
     4  ARG providers
     5  
     6  ENV GOPATH="/go"
     7  ENV PATH="${GOPATH}/bin:${PATH}"
     8  ENV DEBIAN_FRONTEND noninteractive
     9  ENV DEBCONF_NOWARNINGS="yes"
    10  
    11  ENV AIS_BACKEND_PROVIDERS=${providers:-"aws gcp"}
    12  
    13  RUN apt-get update -yq
    14  RUN apt-get --no-install-recommends -y install curl git coreutils
    15  
    16  RUN mkdir -p /go/src/github.com/NVIDIA/aistore
    17  WORKDIR /go/src/github.com/NVIDIA/aistore
    18  
    19  # Clone GitHub and build aisnode
    20  RUN git clone https://github.com/NVIDIA/aistore.git && cd aistore && go mod tidy &&\
    21   GOOS="linux" GOARCH="amd64" CGO_ENABLED=0 BUILD_FLAGS="-a -installsuffix cgo" MODE=${mode} make node
    22  
    23  FROM alpine:latest
    24  
    25  # NOTE: important to reproduce backend providers again
    26  #       for the first (deployment) run
    27  #       where the initial plain-text config gets generated.
    28  ENV AIS_BACKEND_PROVIDERS=${providers:-"aws gcp"}
    29  
    30  # TODO: lsof (installed by default from busybox) doesn't handle `-sTCP:LISTEN` and `tcp@host:port`
    31  RUN apk upgrade --no-cache && \
    32    apk add --no-cache --virtual .build-deps \
    33      bash \
    34      sysstat \
    35      attr \
    36      # for 'lsblk' command
    37      util-linux \
    38    ;
    39  
    40  WORKDIR /build
    41  COPY entrypoint entrypoint/
    42  COPY aisnode_config.sh ./
    43  COPY limits.conf /etc/security/limits.conf
    44  COPY --from=builder /go/bin/aisnode bin/
    45  
    46  EXPOSE 51080/tcp
    47  
    48  ENTRYPOINT ["sh", "-c", "entrypoint/entrypoint.sh \"$@\"", "--"]