From 18345fd4bacf87df28abcd86892922e119ac8e01 Mon Sep 17 00:00:00 2001 From: Anton Ustyuzhanin Date: Mon, 1 Jul 2019 16:26:38 +0200 Subject: [PATCH 1/2] Ignore .git to enforce promu using local paths --- .dockerignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..2d2ecd68 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git/ From bc30380ef28565f57aae00d2792597aaa145b918 Mon Sep 17 00:00:00 2001 From: Anton Ustyuzhanin Date: Mon, 1 Jul 2019 16:27:09 +0200 Subject: [PATCH 2/2] Run rds_exporter as non-privileged user --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a93afa7..3e01c08e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11.2 AS builder +FROM golang:1.12 AS builder WORKDIR /go/src/github.com/hellofresh/rds_exporter COPY . ./ @@ -11,7 +11,10 @@ RUN apt-get update -y \ ca-certificates \ python3-boto3 \ python3-yaml \ - && rm -rf /var/cache/apt/* + && rm -rf /var/cache/apt/* \ + && useradd -ms /bin/bash rds_exporter + +USER rds_exporter COPY --from=builder /go/src/github.com/hellofresh/rds_exporter/rds_exporter / COPY entry.py /