Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-09-05 12:48:06 -04:00
parent 7a35c8fd39
commit 4b7ab239d7
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
2 changed files with 18 additions and 24 deletions

View File

@ -1,31 +1,25 @@
FROM alpine:edge
FROM golang:1.10-alpine AS builder
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go
RUN apk --no-cache add \
ca-certificates \
git
ENV PERKEEP_VERSION 0.10
RUN mkdir -p /go/src/perkeep.org \
&& git clone --depth 1 --branch "${PERKEEP_VERSION}" https://camlistore.googlesource.com/camlistore.git /go/src/perkeep.org \
&& cd /go/src/perkeep.org \
&& go run make.go \
&& cp -vr /go/bin/* /usr/local/bin/ \
&& echo "Build complete."
FROM alpine:latest
RUN apk --no-cache add \
ca-certificates
ENV PERKEEP_VERSION 0.10
RUN buildDeps=' \
go \
git \
gcc \
libc-dev \
libgcc \
' \
set -x \
&& apk --no-cache add $buildDeps \
&& mkdir -p /go/src/perkeep.org \
&& git clone --depth 1 --branch "${PERKEEP_VERSION}" https://camlistore.googlesource.com/camlistore.git /go/src/perkeep.org \
&& cd /go/src/perkeep.org \
&& go run make.go \
&& cp -r /go/bin/* /usr/local/bin/ \
&& apk del $buildDeps \
&& rm -rf /go \
&& echo "Build complete."
COPY --from=builder /usr/local/bin/pk* /usr/bin/
COPY --from=builder /usr/local/bin/perkeepd /usr/bin/perkeepd
ENTRYPOINT [ "perkeepd" ]

View File

@ -23,7 +23,7 @@ RUN git checkout "${TERRAFORM_VERSION}"
# See: https://github.com/golang/go/issues/10249
RUN go install ./vendor/...
RUN XC_ARCH="amd64" XC_OS="linux" LD_FLAGS=" -extldflags -static" make bin \
RUN XC_ARCH="amd64" XC_OS="linux" LD_FLAGS=" -extldflags -static" make fmt bin \
&& mv bin/terraform /usr/bin/terraform
FROM alpine:latest