From c486dfbb7bc6ed7e74013cea92fc80ea894d3722 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Fri, 2 Oct 2015 15:22:23 -0600 Subject: [PATCH] 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"]