feat: builds docker images for running featurebase from a release (#2193)

* adds dockerfile for building images to run examples on

* adds makefile entries to build and push docker runner images

* cleans up tar artifacts when building ingest runner

* moves executables to /usr/local/bin

* moves the sources for building runner images into their own folder

* simplifies makefile and adds directions to readme
This commit is contained in:
CLoZengineer 2022-11-08 13:07:17 -05:00 committed by GitHub
parent daceee2ab6
commit dc27e3d1d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 0 deletions

31
runners/Dockerfile Normal file
View file

@ -0,0 +1,31 @@
ARG FEATUREBASE_URL=https://github.com/FeatureBaseDB/featurebase/releases/download/v1.1.0-community/featurebase-v1.1.0-community-linux-amd64.tar.gz
# builder is responsible for downloads and conforming to naming conventions
FROM alpine:latest as builder
ARG FEATUREBASE_URL
RUN wget -O featurebase.tar.gz ${FEATUREBASE_URL}
RUN tar -zxvf featurebase.tar.gz
RUN mv featurebase-v*/ featurebase/
RUN mv idk-v*/ idk/
###
# runner for featurebase binary
FROM alpine:latest as featurebase
COPY --from=builder /featurebase /usr/local/bin
WORKDIR /home/featurebase
###
# runner for IDK
FROM alpine:latest as ingest
COPY --from=builder /idk /idk
WORKDIR idk
# Alpine tar command seems to leave meta files behind, this removes them
RUN rm \._*
RUN chmod ug+x *
RUN mv /idk/* /usr/local/bin
RUN rm -rf /idk
WORKDIR /home/ingester

14
runners/Makefile Normal file
View file

@ -0,0 +1,14 @@
.PHONY: build-runners push-runners
TAG_ROOT=ghcr.io/featurebasedb/examples
TAG_FB_RUNNER=$(TAG_ROOT)/featurebase-runner
TAG_INGEST_RUNNER=$(TAG_ROOT)/ingest-runner
TAG_VERSION=latest
build-runners:
docker build --target=featurebase -t$(TAG_FB_RUNNER):$(TAG_VERSION) -f Dockerfile ../
docker build --target=ingest -t$(TAG_INGEST_RUNNER):$(TAG_VERSION) -f Dockerfile ../
push-runners:
docker push $(TAG_FB_RUNNER):$(TAG_VERSION)
docker push $(TAG_INGEST_RUNNER):$(TAG_VERSION)

10
runners/README.md Normal file
View file

@ -0,0 +1,10 @@
# FeatureBase Runners
Docker images for running FeatureBase.
## Build and Push Runners
`make build-runners`
`make push-runners`
** Requires the user to log into the target docker repository. **