diff --git a/Makefile b/Makefile index d5a8f17..ad58c16 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ vendor-update: vendor-install: @echo Installing vendored packages - @$(DEPENV) dep ensure -v -vendor-only + @$(DEPENV) dep ensure -v -vendor-only || $(MAKE) vendor-install @echo test: check-reqs diff --git a/extras/debian.Dockerfile b/extras/debian.Dockerfile index 47c443e..b369c81 100644 --- a/extras/debian.Dockerfile +++ b/extras/debian.Dockerfile @@ -5,7 +5,9 @@ RUN mkdir -p /go/src/github.com/gluster/gluster-prometheus/ WORKDIR /go/src/github.com/gluster/gluster-prometheus/ -RUN apt-get -q update && apt-get install -y bash curl make git +RUN set -ex && \ + export DEBIAN_FRONTEND=noninteractive; \ + apt-get -q update && apt-get install -y --no-install-recommends bash curl make git COPY . . @@ -14,18 +16,21 @@ RUN PREFIX=/app make RUN PREFIX=/app make install # Create small image for running -FROM debian:stretch +FROM debian:stretch-slim ARG GLUSTER_VERSION=6 # Install gluster cli for gluster-exporter -RUN apt-get -q update && apt-get install -y gnupg curl apt-transport-https && \ +RUN set -ex && \ + export DEBIAN_FRONTEND=noninteractive; \ + apt-get -q update && apt-get install -y --no-install-recommends gnupg curl apt-transport-https ca-certificates && \ DEBID=$(grep 'VERSION_ID=' /etc/os-release | cut -d '=' -f 2 | tr -d '"') && \ DEBVER=$(grep 'VERSION=' /etc/os-release | grep -Eo '[a-z]+') && \ DEBARCH=$(dpkg --print-architecture) && \ curl -sSL http://download.gluster.org/pub/gluster/glusterfs/${GLUSTER_VERSION}/rsa.pub | apt-key add - && \ echo deb https://download.gluster.org/pub/gluster/glusterfs/${GLUSTER_VERSION}/LATEST/Debian/${DEBID}/${DEBARCH}/apt ${DEBVER} main > /etc/apt/sources.list.d/gluster.list && \ - apt-get -q update && apt-get install -y glusterfs-server && apt-get clean all + apt-get -q update && apt-get install -y --no-install-recommends glusterfs-server && apt-get clean all && \ + rm -Rf /var/lib/apt/lists/* /tmp/* /var/tmp/* WORKDIR /app