docker: the docker image will now contain just the static binary

This commit is contained in:
Krishna Srinivas
2015-11-06 16:46:04 -08:00
parent 8ef4ec24ca
commit 440bec28d9
7 changed files with 94 additions and 49 deletions

View File

@@ -1,38 +1,8 @@
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
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
# use "make dockerimage" to build
FROM scratch
ENV DOCKERIMAGE 1
ADD minio.dockerimage /minio
ADD export /export
EXPOSE 9000
CMD ["sh", "-c", "${GOPATH}/bin/minio server"]
ENTRYPOINT ["/minio"]
CMD ["server", "/export"]