Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwickenden committed Nov 29, 2018
1 parent ca3acdb commit 1ce917c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM golang:alpine AS build

RUN apk add --no-cache \
git \
curl

RUN mkdir -p /out/usr/local/bin

ENV KUBELETMEIN $GOPATH/src/github.com/4armed/kubeletmein
RUN mkdir -p "$(dirname ${KUBELETMEIN})"
COPY . $KUBELETMEIN

WORKDIR $KUBELETMEIN
RUN go build ./cmd/kubeletmein && cp ./kubeletmein /out/usr/local/bin/kubeletmein

WORKDIR /out
RUN curl -sL https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl -o usr/local/bin/kubectl && \
chmod +x usr/local/bin/kubectl

FROM google/cloud-sdk:alpine
LABEL maintainer="Marc Wickenden <[email protected]>"

RUN addgroup -S app && adduser -S app -G app

COPY --from=build /out /
USER app
WORKDIR /home/app

CMD [ "kubeletmein" ]

0 comments on commit 1ce917c

Please sign in to comment.