diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fb3e859..fb5a4c18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -250,10 +250,15 @@ kubetools: - - - - +redis_exporter: + <<: *docker_build + variables: + CONTAINER_IMAGE: $CI_JOB_NAME + CONTAINER_TAG: latest + DOCKERFILE_DIR: $CI_JOB_NAME + only: + variables: + - $DOCKERIMAGE == $CI_JOB_NAME # vim: expandtab sts=2 diff --git a/dockerfiles/redis_exporter/Dockerfile b/dockerfiles/redis_exporter/Dockerfile new file mode 100644 index 00000000..98149710 --- /dev/null +++ b/dockerfiles/redis_exporter/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:1.13-alpine as builder + +RUN apk --no-cache add ca-certificates git + +RUN go get github.com/oliver006/redis_exporter +RUN cd $GOPATH/src/github.com/oliver006/redis_exporter && go build + + +FROM alpine as alpine +COPY --from=builder /go/src/github.com/oliver006/redis_exporter/redis_exporter /redis_exporter +COPY --from=builder /etc/ssl/certs /etc/ssl/certs + +# Run as non-root user for secure environments +USER 59000:59000 + +EXPOSE 9121 +ENTRYPOINT [ "/redis_exporter" ] + + diff --git a/dockerfiles/redis_exporter/README.md b/dockerfiles/redis_exporter/README.md new file mode 100644 index 00000000..1658f318 --- /dev/null +++ b/dockerfiles/redis_exporter/README.md @@ -0,0 +1,4 @@ +# redis exporter + +build docker image from https://github.com/oliver006/redis_exporter +