Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize image size #164

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions extras/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .

Expand All @@ -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

Expand Down