minio/Dockerfile
Matt Butcher c486dfbb7b Add non-root minio user.
This adds a minio user and runs minio as that user instead of
as root.
2015-10-02 15:22:23 -06:00

40 lines
857 B
Docker

FROM ubuntu-debootstrap:14.04
MAINTAINER Minio Community
ENV GOLANG_TARBALL go1.5.1.linux-amd64.tar.gz
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 \
build-essential \
ca-certificates \
yasm
RUN curl -O -s https://storage.googleapis.com/golang/${GOLANG_TARBALL} && \
tar -xzf ${GOLANG_TARBALL} -C ${GOROOT%*go*} && \
rm ${GOLANG_TARBALL}
ADD . ${GOPATH}/src/github.com/minio/minio
RUN cd ${GOPATH}/src/github.com/minio/minio && \
make
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"]