-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 675 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# build stage
FROM golang:alpine AS build-env
RUN apk add git gcc
WORKDIR $GOPATH/src/github.com/michaelfig/k8s-copier
COPY . .
# Download all the dependencies
RUN GO111MODULE=on go mod vendor
# FIXME: Edit the non-namespaced dynamicinformer
RUN sed -i -e 's/namespace:.*,/namespace: namespace,/' \
vendor/k8s.io/client-go/dynamic/dynamicinformer/informer.go
# Install the binaries
RUN go install -v ./cmd/k8s-copier
WORKDIR /app
RUN cp $GOPATH/bin/k8s-copier /app/
# final stage
FROM alpine
LABEL maintainer="Michael FIG <michael+k8s-copier@fig.org>"
WORKDIR /app
COPY --from=build-env /app/k8s-copier /bin/k8s-copier
USER nobody
ENTRYPOINT ["/bin/k8s-copier"]