mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-05 08:10:50 +00:00
backport Dockerfile and docker build command
we got "build dependency yarn not installed" in CI when it tried to build the release. The new Dockerfile has a separate lattice builder which does "yarn install"
This commit is contained in:
parent
909e159aaa
commit
ddfaa65d0e
2 changed files with 44 additions and 8 deletions
41
Dockerfile
41
Dockerfile
|
|
@ -1,19 +1,46 @@
|
|||
FROM golang:latest as builder
|
||||
ARG GO_VERSION=latest
|
||||
|
||||
ARG BUILD_FLAGS
|
||||
#######################
|
||||
### Lattice builder ###
|
||||
#######################
|
||||
|
||||
FROM moleculacorp/nodejs:latest 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
|
||||
WORKDIR /pilosa
|
||||
|
||||
COPY . pilosa
|
||||
RUN go get github.com/rakyll/statik
|
||||
|
||||
RUN cd pilosa && make install FLAGS="-a -mod=vendor ${BUILD_FLAGS}" ${MAKE_FLAGS}
|
||||
COPY . ./
|
||||
COPY --from=lattice-builder /lattice/build /lattice
|
||||
RUN /go/bin/statik -src=/lattice -dest=/pilosa
|
||||
|
||||
FROM alpine:3.12.1
|
||||
RUN make build FLAGS="-o build/pilosa" ${MAKE_FLAGS}
|
||||
|
||||
LABEL maintainer "dev@pilosa.com"
|
||||
#####################
|
||||
### Pilosa runner ###
|
||||
#####################
|
||||
|
||||
FROM alpine:3.13.2 as runner
|
||||
|
||||
LABEL maintainer "dev@molecula.com"
|
||||
|
||||
RUN apk add --no-cache curl jq
|
||||
|
||||
COPY --from=builder /go/bin/pilosa /pilosa
|
||||
COPY --from=pilosa-builder /pilosa/build/pilosa /
|
||||
|
||||
COPY LICENSE /LICENSE
|
||||
COPY NOTICE /NOTICE
|
||||
|
|
|
|||
11
Makefile
11
Makefile
|
|
@ -212,7 +212,16 @@ docker-release: check-clean generate-statik
|
|||
|
||||
# Compile Pilosa inside Docker container
|
||||
docker-build: vendor
|
||||
docker run --rm -v $(PWD):/go/src/$(CLONE_URL) -w /go/src/$(CLONE_URL) -e GOOS=$(GOOS) -e GOARCH=$(GOARCH) golang:$(GO_VERSION) make build FLAGS="$(FLAGS) -mod=vendor" RELEASE=$(RELEASE)
|
||||
docker build \
|
||||
--build-arg GO_VERSION=$(GO_VERSION) \
|
||||
--build-arg MAKE_FLAGS="GOOS=$(GOOS) GOARCH=$(GOARCH)" \
|
||||
--target pilosa-builder \
|
||||
--tag pilosa:build .
|
||||
docker create --name pilosa-build pilosa:build
|
||||
mkdir -p build/pilosa-$(VERSION_ID)
|
||||
docker cp pilosa-build:/pilosa/build/. ./build/pilosa-$(VERSION_ID)
|
||||
docker rm pilosa-build
|
||||
tar -cvz -C build -f build/pilosa-$(VERSION_ID).tar.gz pilosa-$(VERSION_ID)/
|
||||
|
||||
# Install diagnostic pilosa-keydump tool. Allows viewing the keys in a transaction-engine directory.
|
||||
pilosa-keydump:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue