From 37a02670f5d19c4fd240f27fc16a3aa0577aa1a5 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Fri, 2 Oct 2015 13:38:51 -0600 Subject: [PATCH 1/2] Use ubuntu-debootstrap and Go 1.5.1. Currently, the Dockerfile is broken because it installs Go 1.5 while the minimum required version is 1.5.1. Also, switch to a minimval version of Ubuntu (ubuntu-debootstrap) and reduce the image size by 70M in unneeded dependencies. --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e21b2a56c..5bdaaaa8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ - -FROM ubuntu:14.04 +FROM ubuntu-debootstrap:14.04 MAINTAINER Minio Community -ENV GOLANG_TARBALL go1.5.linux-amd64.tar.gz +ENV GOLANG_TARBALL go1.5.1.linux-amd64.tar.gz ENV GOROOT /usr/local/go/ ENV GOPATH /go-workspace From c486dfbb7bc6ed7e74013cea92fc80ea894d3722 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Fri, 2 Oct 2015 15:22:23 -0600 Subject: [PATCH 2/2] Add non-root minio user. This adds a minio user and runs minio as that user instead of as root. --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5bdaaaa8c..5ec2d24b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,10 @@ ENV GOROOT /usr/local/go/ ENV GOPATH /go-workspace ENV PATH ${GOROOT}/bin:${GOPATH}/bin/:$PATH +ENV MINIOHOME /home/minio +ENV MINIOUSER minio +RUN useradd -m -d $MINIOHOME $MINIOUSER + RUN apt-get update -y && apt-get install -y -q \ curl \ git \ @@ -28,6 +32,8 @@ RUN apt-get remove -y build-essential curl git && \ apt-get -y autoremove && \ rm -rf /var/lib/apt/lists/* +USER minio + EXPOSE 9000 9001 CMD ["sh", "-c", "${GOPATH}/bin/minio server"]