forked from pingcap/dm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (22 loc) · 876 Bytes
/
Dockerfile
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
31
32
33
FROM golang:1.13-alpine as builder
MAINTAINER siddontang
RUN apk add --no-cache \
git make wget
RUN wget http://download.pingcap.org/tidb-enterprise-tools-latest-linux-amd64.tar.gz && \
tar -xzf tidb-enterprise-tools-latest-linux-amd64.tar.gz && \
mv tidb-enterprise-tools-latest-linux-amd64 /opt/tools
RUN mkdir -p /go/src/github.com/pingcap/dm
WORKDIR /go/src/github.com/pingcap/dm
# Cache dependencies
COPY go.mod .
COPY go.sum .
RUN GO111MODULE=on go mod download
COPY . .
RUN apk update && apk add bash
RUN make dm-worker dm-master dmctl
FROM alpine:3.10
COPY --from=builder /go/src/github.com/pingcap/dm/bin/dm-worker /dm-worker
COPY --from=builder /go/src/github.com/pingcap/dm/bin/dm-master /dm-master
COPY --from=builder /go/src/github.com/pingcap/dm/bin/dmctl /dmctl
COPY --from=builder /opt/tools/bin/mydumper /mydumper
EXPOSE 8291 8261 8262