Use Debian go image in Dockerfile

The build needs bash in order to process build tags correctly. Alpine
doesn't come with bash... Debian comes with all the things we need out
of the box, so let's just use that.
This commit is contained in:
Brian Goff
2019-04-01 15:14:21 -07:00
parent 80de7fd566
commit 1dadd46e20

View File

@@ -1,25 +1,12 @@
FROM golang:alpine as builder
FROM golang:1.12 as builder
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go
RUN apk add --no-cache \
ca-certificates \
--virtual .build-deps \
git \
gcc \
libc-dev \
libgcc \
make \
bash
COPY . /go/src/github.com/virtual-kubelet/virtual-kubelet
WORKDIR /go/src/github.com/virtual-kubelet/virtual-kubelet
ARG BUILD_TAGS="netgo osusergo"
RUN make VK_BUILD_TAGS="${BUILD_TAGS}" build
RUN cp bin/virtual-kubelet /usr/bin/virtual-kubelet
FROM scratch
COPY --from=builder /usr/bin/virtual-kubelet /usr/bin/virtual-kubelet
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs