-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update dockerfile and makefile (#625)
Signed-off-by: James Yin <[email protected]>
- Loading branch information
Showing
9 changed files
with
135 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.18 as builder | ||
FROM --platform=$BUILDPLATFORM golang:1.19 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY . . | ||
RUN go mod download | ||
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||
COPY go.mod go.sum ./ | ||
RUN go mod download && go mod verify | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY . . | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build-controller | ||
|
||
FROM --platform=$BUILDPLATFORM ubuntu:22.10 | ||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
tzdata \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /vanus | ||
|
||
COPY --from=builder /workspace/bin/controller bin/controller | ||
ENTRYPOINT ["bin/controller"] | ||
|
||
CMD ["bin/controller"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.18 as builder | ||
FROM --platform=$BUILDPLATFORM golang:1.19 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY . . | ||
RUN go mod download | ||
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||
COPY go.mod go.sum ./ | ||
RUN go mod download && go mod verify | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY . . | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build-gateway | ||
|
||
FROM --platform=$BUILDPLATFORM ubuntu:22.10 | ||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
WORKDIR /vanus | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
tzdata \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /workspace/bin/gateway bin/gateway | ||
ENTRYPOINT ["bin/gateway"] | ||
|
||
CMD ["bin/gateway"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.18 as builder | ||
FROM --platform=$BUILDPLATFORM golang:1.19 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY . . | ||
RUN go mod download | ||
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||
COPY go.mod go.sum ./ | ||
RUN go mod download && go mod verify | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY . . | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build-root | ||
|
||
FROM --platform=$BUILDPLATFORM ubuntu:22.10 | ||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
WORKDIR /vanus | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
tzdata \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /workspace/bin/root-controller bin/root-controller | ||
ENTRYPOINT ["bin/root-controller"] | ||
|
||
CMD ["bin/root-controller"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.18 as builder | ||
FROM --platform=$BUILDPLATFORM golang:1.19 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY . . | ||
RUN go mod download | ||
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||
COPY go.mod go.sum ./ | ||
RUN go mod download && go mod verify | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build-store | ||
|
||
FROM --platform=$BUILDPLATFORM ubuntu:22.10 | ||
COPY . . | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build-store && \ | ||
GOOS=$TARGETOS GOARCH=$TARGETARCH make build-vsrepair | ||
|
||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
WORKDIR /vanus | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
tzdata \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /workspace/bin/store bin/store | ||
ENTRYPOINT ["bin/store"] | ||
COPY --from=builder /workspace/bin/vsrepair bin/vsrepair | ||
|
||
CMD ["bin/store"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.18 as builder | ||
FROM --platform=$BUILDPLATFORM golang:1.19 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY . . | ||
RUN go mod download | ||
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||
COPY go.mod go.sum ./ | ||
RUN go mod download && go mod verify | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY . . | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build-timer | ||
|
||
FROM --platform=$BUILDPLATFORM ubuntu:22.10 | ||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
tzdata \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /vanus | ||
|
||
COPY --from=builder /workspace/bin/timer bin/timer | ||
ENTRYPOINT ["bin/timer"] | ||
|
||
CMD ["bin/timer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.18 as builder | ||
FROM --platform=$BUILDPLATFORM golang:1.19 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY . . | ||
RUN go mod download | ||
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||
COPY go.mod go.sum ./ | ||
RUN go mod download && go mod verify | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY . . | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build-trigger | ||
|
||
FROM --platform=$BUILDPLATFORM ubuntu:22.10 | ||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
tzdata \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /vanus | ||
|
||
COPY --from=builder /workspace/bin/trigger bin/trigger | ||
ENTRYPOINT ["bin/trigger"] | ||
|
||
CMD ["bin/trigger"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters