Skip to content

Commit

Permalink
chore: add kotsadm-operator skaffold cache
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Stough <dans@replicated.com>
  • Loading branch information
Dan Stough committed Jul 23, 2021
1 parent 2b35fef commit e6b8765
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ project-pact-tests:
.PHONY: cache
cache:
docker build -f hack/dev/Dockerfile.skaffoldcache . -t kotsadm:cache
docker build -f kotsadm/operator/Dockerfile.skaffoldcache kotsadm/operator -t kotsadm-operator:cache
2 changes: 1 addition & 1 deletion hack/dev/Dockerfile.skaffoldcache
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ COPY cmd ./cmd
COPY pkg ./pkg
COPY kotskinds ./kotskinds

RUN make kotsadm
RUN make kotsadm
33 changes: 21 additions & 12 deletions kotsadm/operator/Dockerfile.skaffold
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
FROM golang:1.16 as deps
FROM kotsadm-operator:cache AS builder

ENV PROJECTPATH=/go/src/github.com/replicatedhq/kots/kotsadm/operator
WORKDIR $PROJECTPATH
ADD Makefile ./
ADD Makefile.build ./
ADD go.mod ./
ADD go.sum ./
ADD cmd ./cmd
ADD pkg ./pkg

RUN make build

FROM debian:buster
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*

ENV GO111MODULE=on
ENV PATH="/usr/local/bin:$PATH"

# Install Kubectl 1.14
ENV KUBECTL_1_14_VERSION=v1.14.9
Expand Down Expand Up @@ -50,15 +68,6 @@ RUN curl -L "https://get.helm.sh/helm-v3.4.2-linux-amd64.tar.gz" -o /tmp/helm.ta
chmod a+x linux-amd64/helm && \
mv linux-amd64/helm "/usr/local/bin/helm3.4.2"

ENV PROJECTPATH=/go/src/github.com/replicatedhq/kots/kotsadm/operator
WORKDIR $PROJECTPATH
ADD Makefile ./
ADD Makefile.build ./
ADD go.mod ./
ADD go.sum ./
ADD cmd ./cmd
ADD pkg ./pkg

RUN make build
COPY --from=builder /go/src/github.com/replicatedhq/kots/kotsadm/operator/bin/kotsadm-operator .

ENTRYPOINT ["./bin/kotsadm-operator"]
ENTRYPOINT ["/kotsadm-operator"]
12 changes: 12 additions & 0 deletions kotsadm/operator/Dockerfile.skaffoldcache
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.16 as deps

ENV PROJECTPATH=/go/src/github.com/replicatedhq/kots/kotsadm/operator
WORKDIR $PROJECTPATH
COPY Makefile ./
COPY Makefile.build ./
COPY go.mod ./
COPY go.sum ./
COPY cmd ./cmd
COPY pkg ./pkg

RUN make build

0 comments on commit e6b8765

Please sign in to comment.