github.com/iotexproject/iotex-core@v1.14.1-rc1/Dockerfile (about)

     1  FROM golang:1.19.12-alpine as build
     2  
     3  WORKDIR apps/iotex-core
     4  
     5  RUN apk add --no-cache make gcc musl-dev linux-headers git ca-certificates
     6  
     7  COPY go.mod .
     8  COPY go.sum .
     9  
    10  RUN go mod download
    11  
    12  COPY . .
    13  ARG PACKAGE_VERSION
    14  ARG PACKAGE_COMMIT_ID
    15  ARG GIT_STATUS
    16  RUN mkdir -p $GOPATH/pkg/linux_amd64/github.com/iotexproject/ && \
    17      PACKAGE_VERSION=$PACKAGE_VERSION PACKAGE_COMMIT_ID=$PACKAGE_COMMIT_ID GIT_STATUS=$GIT_STATUS make clean build-all
    18  
    19  FROM alpine
    20  
    21  RUN mkdir -p /etc/iotex/
    22  COPY --from=build /go/apps/iotex-core/bin/server /usr/local/bin/iotex-server
    23  COPY --from=build /go/apps/iotex-core/bin/actioninjectorv2 /usr/local/bin/iotex-actioninjectorv2
    24  COPY --from=build /go/apps/iotex-core/bin/addrgen /usr/local/bin/iotex-addrgen
    25  COPY --from=build /go/apps/iotex-core/bin/ioctl /usr/local/bin/ioctl
    26  
    27  
    28  # logrotate log file daily
    29  RUN apk add --no-cache logrotate
    30  COPY logrotate.conf /etc/logrotate.d/iotex
    31  RUN mkdir -p /var/lib/
    32  RUN touch /var/lib/logrotate.status
    33  RUN echo -e "#!/bin/sh\n\n/usr/sbin/logrotate -f /etc/logrotate.d/iotex" > /etc/periodic/daily/logrotate
    34  
    35  COPY entrypoint.sh /usr/local/bin
    36  RUN chmod +x /usr/local/bin/entrypoint.sh
    37  ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
    38  CMD ["iotex-server"]