Merge pull request #1737 from molecula/CI/build-containers

[CORE-898] Create FeatureBase Docker Images in CI
This commit is contained in:
Samir Patel 2021-11-02 09:41:24 -05:00 committed by GitHub
commit 4fd2a4fedd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View file

@ -3,6 +3,9 @@ include:
- template: Security/License-Scanning.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
variables:
GOVERSION: "1.16.9"
stages:
- test
- build
@ -137,3 +140,19 @@ build for darwin arm64:
artifacts:
paths:
- featurebase_darwin_arm64
# Build a FB Docker image with CI/CD and push to the GitLab registry.
build container fb:
image: docker:stable
stage: build
needs:
- "build for linux amd64"
tags:
- shell
before_script:
- echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY}
script:
- tag=${CI_REGISTRY_IMAGE}/server:${CI_COMMIT_REF_SLUG}
- docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile .
- docker push $tag
- echo Created docker featurebase image with tag "$tag"

23
.gitlab/Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM alpine:3.14.2
LABEL maintainer "dev@molecula.com"
LABEL org.opencontainers.image.authors="dev@molecula.com"
WORKDIR /featurebase
RUN apk add --no-cache curl jq
COPY LICENSE .
COPY NOTICE .
COPY featurebase_linux_amd64 .
RUN chmod ugo+x .
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"]