featurebase/Dockerfile
Garrison Davis d0ea451bcc Use SOURCE_DATE_EPOCH to make reproducible builds
Reproducible builds are something we should be doing, and we are there
as far as making them in CI is concerned with this change.

The changes to the Dockerfile/Makefile do nothing if the
SOURCE_DATE_EPOCH environment variable is not set before `make build`
happens, or if the build arg is not passed in to docker.

(cherry picked from commit fd93fc99c9)
2022-12-12 09:01:20 -08:00

58 lines
1.1 KiB
Docker

ARG GO_VERSION=latest
#######################
### Lattice builder ###
#######################
FROM ghcr.io/featurebasedb/nodejs:0.0.1 as lattice-builder
WORKDIR /lattice
COPY lattice/package.json ./
COPY lattice/yarn.lock ./
RUN yarn install
COPY lattice ./
RUN yarn build
######################
### Pilosa builder ###
######################
FROM golang:${GO_VERSION} as pilosa-builder
ARG MAKE_FLAGS
ARG SOURCE_DATE_EPOCH
WORKDIR /pilosa
RUN go install github.com/rakyll/statik@v0.1.7
COPY . ./
COPY --from=lattice-builder /lattice/build /lattice
RUN /go/bin/statik -src=/lattice -dest=/pilosa
ENV SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH
RUN make build FLAGS="-o build/featurebase" ${MAKE_FLAGS}
#####################
### Pilosa runner ###
#####################
FROM alpine:3.13.2 as runner
LABEL maintainer "dev@molecula.com"
RUN apk add --no-cache curl jq tree
COPY --from=pilosa-builder /pilosa/build/featurebase /
COPY NOTICE /NOTICE
EXPOSE 10101
VOLUME /data
ENV PILOSA_DATA_DIR /data
ENV PILOSA_BIND 0.0.0.0:10101
ENV PILOSA_BIND_GRPC 0.0.0.0:20101
ENTRYPOINT ["/featurebase"]
CMD ["server"]