From f0a93a4d2719ed50c11fb62418141d70a366732c Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 15 Jan 2016 10:35:49 -0800 Subject: [PATCH 1/4] fix(Makefile): remove docker-build dependency in docker-push --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 731c564..7bf9b74 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ docker-build: build-server perl -pi -e "s|image: [a-z0-9.:]+\/deis\/${SHORT_NAME}:[0-9a-z-.]+|image: ${IMAGE}|g" ${RC} perl -pi -e "s|release: [a-zA-Z0-9.+_-]+|release: ${VERSION}|g" ${RC} -docker-push: docker-build +docker-push: docker push ${IMAGE} deploy: build docker-build docker-push kube-rc From ce8d1a58fe03315870df8256285997b66109caf1 Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 15 Jan 2016 10:46:13 -0800 Subject: [PATCH 2/4] fix(Dockerfile): convert minio server dockerfile to be based on alpine --- rootfs/Dockerfile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 4a2f239..e00c525 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -1,13 +1,7 @@ -FROM ubuntu-debootstrap:14.04 +FROM alpine:3.3 -ENV MINIOHOME /home/minio -ENV MINIOUSER minio ENV DEIS_RELEASE=2.0.0-dev -RUN useradd -m -d $MINIOHOME $MINIOUSER -RUN apt-get update -y && apt-get install -y -q ca-certificates curl -RUN curl -f -SL https://dl.minio.io:9000/updates/2015/Sept/linux-amd64/mc -o /usr/bin/mc -RUN chmod 755 /usr/bin/mc +RUN apk add -U ca-certificates COPY . / -USER minio -RUN mkdir /home/minio/.minio +ENV DOCKERIMAGE=1 CMD "boot" From 319721b78b78beb14124db8032485b9c5605111d Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 15 Jan 2016 10:47:17 -0800 Subject: [PATCH 3/4] fix(install.sh): build minio server as static binary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can’t turn off CGO, but this is enough to get a minio server binary that can run in alpine, as long as DOCKERIMAGE is set to 1 in the environment in which it runs --- server/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/install.sh b/server/install.sh index a2ce2d2..313a25f 100755 --- a/server/install.sh +++ b/server/install.sh @@ -13,5 +13,4 @@ mkdir -p $GOPATH/src/github.com/minio cd $GOPATH/src/github.com/minio curl -L -O -s https://github.com/minio/minio/archive/master.tar.gz && tar -xvzf master.tar.gz && rm master.tar.gz && mv minio-master minio cd minio -make install -cp $GOPATH/bin/minio /pwd/minio +go build --ldflags '-extldflags -static' -o /pwd/minio From e730b51c3bf05e6f54fc6ac8497c6ba580e64f5e Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 15 Jan 2016 11:20:35 -0800 Subject: [PATCH 4/4] fix(Makefile,server/install.sh): use the minio makefile target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of manually building with ‘go build’ --- Makefile | 3 ++- server/install.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7bf9b74..1ec92f3 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,8 @@ kube-mc-integration: # build the minio server build-server: - docker run -e GO15VENDOREXPERIMENT=1 -e GOROOT=/usr/local/go --rm -v "${CURDIR}/server":/pwd -w /pwd golang:1.5.2 ./install.sh + # the PWD environment variable is a workaround to ensure that the 'checkdeps' build target works in the minio repo + docker run -e CGO_ENABLED=0 -e GO15VENDOREXPERIMENT=1 -e GOPATH=/go -e GOROOT=/usr/local/go -v ${GOPATH}:/go -w /go/src/github.com/minio/minio -e PWD=/go/src/github.com/minio/minio golang:1.5.2 make mc-build: make -C mc build diff --git a/server/install.sh b/server/install.sh index 313a25f..2de05d5 100755 --- a/server/install.sh +++ b/server/install.sh @@ -13,4 +13,5 @@ mkdir -p $GOPATH/src/github.com/minio cd $GOPATH/src/github.com/minio curl -L -O -s https://github.com/minio/minio/archive/master.tar.gz && tar -xvzf master.tar.gz && rm master.tar.gz && mv minio-master minio cd minio -go build --ldflags '-extldflags -static' -o /pwd/minio +make +cp $GOPATH/bin/minio /pwd/minio