Add non-root minio user.

This adds a minio user and runs minio as that user instead of
as root.
This commit is contained in:
Matt Butcher 2015-10-02 15:22:23 -06:00
parent 37a02670f5
commit c486dfbb7b

View file

@ -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"]