1
- FROM golang:1.14-alpine as builder
2
-
3
- RUN apk --no-cache --update add make git gcc musl-dev mariadb-client
1
+ FROM golang:1.16-buster as builder
4
2
5
3
RUN mkdir -p /go/src/github.com/signal18/replication-manager
6
4
WORKDIR /go/src/github.com/signal18/replication-manager
@@ -9,69 +7,20 @@ COPY . .
9
7
10
8
RUN make pro cli
11
9
12
- FROM alpine:3 AS builder2
13
-
14
- RUN mkdir -p /build
15
-
16
- WORKDIR /build
17
-
18
- RUN apk add --virtual .build-deps git build-base automake autoconf libtool mariadb-dev --update \
19
- && git clone https://github.com/akopytov/sysbench.git \
20
- && cd /build/sysbench \
21
- && ./autogen.sh \
22
- && ./configure --disable-shared \
23
- && make install \
24
- && apk del .build-deps
25
-
26
- WORKDIR /build
27
-
28
- RUN apk add -t build-depends build-base automake bzip2 patch git cmake openssl-dev zlib-dev libc6-compat libexecinfo-dev && \
29
- git clone https://github.com/sysown/proxysql.git && \
30
- cd /build/proxysql && \
31
- git checkout v1.4.12 && \
32
- make clean && \
33
- make build_deps && \
34
- NOJEMALLOC =1 make
35
-
36
- WORKDIR /build
37
-
38
- RUN export LIB_PACKAGES =' glib mysql-client pcre' && \
39
- export BUILD_PACKAGES =' glib-dev mariadb-dev zlib-dev pcre-dev libressl-dev cmake build-base' && \
40
- apk add --no-cache --update $LIB_PACKAGES $BUILD_PACKAGES && \
41
- git clone -b no-flush https://github.com/tanji/mydumper && \
42
- cd mydumper && \
43
- cmake . && \
44
- make && \
45
- apk del $BUILD_PACKAGES
46
-
47
- FROM alpine:3
10
+ FROM debian:bullseye-slim
48
11
49
12
RUN mkdir -p \
50
13
/etc/replication-manager \
51
14
/etc/replication-manager/cluster.d \
52
15
/var/lib/replication-manager
53
16
54
- RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
55
-
56
17
57
18
COPY --from =builder /go/src/github.com/signal18/replication-manager/etc/local/config.toml.docker /etc/replication-manager/config.toml
58
19
COPY --from =builder /go/src/github.com/signal18/replication-manager/etc/local/masterslave/haproxy/config.toml /etc/replication-manager/cluster.d/localmasterslavehaproxy.toml
59
20
COPY --from =builder /go/src/github.com/signal18/replication-manager/etc/local/masterslave/proxysql/config.toml /etc/replication-manager/cluster.d/localmasterslaveproxysql.toml
60
21
61
-
62
-
63
- COPY --from =builder /go/src/github.com/signal18/replication-manager/share /usr/share/replication-manager/
64
- COPY --from =builder /go/src/github.com/signal18/replication-manager/dashboard /usr/share/replication-manager/dashboard
65
- COPY --from =builder /go/src/github.com/signal18/replication-manager/build/binaries/replication-manager-pro /usr/bin/replication-manager
66
- COPY --from =builder /go/src/github.com/signal18/replication-manager/build/binaries/replication-manager-cli /usr/bin/replication-manager-cli
67
- COPY --from =builder2 /build/mydumper/mydumper /usr/bin/mydumper
68
- COPY --from =builder2 /build/mydumper/myloader /usr/bin/myloader
69
- COPY --from =builder2 /build/proxysql/src/proxysql /usr/bin/proxysql
70
- COPY --from =builder2 /usr/local/share/sysbench /usr/local/share/sysbench
71
- COPY --from =builder2 /usr/local/bin/sysbench /usr/bin/sysbench
72
-
73
- RUN apk --no-cache --update add ca-certificates restic mariadb-client mariadb haproxy mariadb-dev fuse glib pcre openssl-dev zlib-dev libc6-compat libexecinfo-dev
74
-
75
-
22
+ RUN apt-get update && apt-get -y install mydumper
23
+ RUN apt-get -y install ca-certificates restic mariadb-client haproxy libmariadb-dev fuse sysbench curl
24
+ RUN curl -LO https://github.com/sysown/proxysql/releases/download/v2.2.0/proxysql_2.2.0-debian10_amd64.deb && dpkg -i proxysql_2.2.0-debian10_amd64.deb
76
25
CMD [" replication-manager" , " monitor" , " --http-server" ]
77
26
EXPOSE 10001
0 commit comments