forked from wish/katalog-sync
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (16 loc) · 771 Bytes
/
Dockerfile
File metadata and controls
22 lines (16 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM --platform=$BUILDPLATFORM golang:alpine as builder
ARG BUILDPLATFORM
ARG TARGETARCH
ARG TARGETOS
ENV GOARCH=${TARGETARCH} GOOS=${TARGETOS}
WORKDIR /go/src/github.com/wish/katalog-sync
# Cache dependencies
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . /go/src/github.com/wish/katalog-sync
RUN cd /go/src/github.com/wish/katalog-sync/cmd/katalog-sync-daemon && CGO_ENABLED=0 go build
RUN cd /go/src/github.com/wish/katalog-sync/cmd/katalog-sync-sidecar && CGO_ENABLED=0 go build
FROM golang:alpine
COPY --from=builder /go/src/github.com/wish/katalog-sync/cmd/katalog-sync-daemon/katalog-sync-daemon /bin/katalog-sync-daemon
COPY --from=builder /go/src/github.com/wish/katalog-sync/cmd/katalog-sync-sidecar/katalog-sync-sidecar /bin/katalog-sync-sidecar