forked from hanchuanchuan/goInception
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
68 lines (52 loc) · 2.46 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM golang:1.14-alpine as builder
# MAINTAINER hanchuanchuan <[email protected]>
ENV TZ=Asia/Shanghai
ENV LANG="en_US.UTF-8"
RUN apk add --no-cache \
ca-certificates wget \
make \
git \
gcc \
musl-dev
RUN wget -q -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget -q -O /glibc.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk \
&& chmod +x /usr/local/bin/dumb-init
COPY bin/goInception /goInception
# COPY bin/percona-toolkit.tar.gz /tmp/percona-toolkit.tar.gz
COPY bin/pt-online-schema-change /tmp/pt-online-schema-change
COPY bin/gh-ost /tmp/gh-ost
COPY config/config.toml.default /etc/config.toml
# Executable image
FROM alpine
COPY --from=builder /glibc.apk /glibc.apk
COPY --from=builder /etc/apk/keys/sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub
COPY --from=builder /goInception /goInception
COPY --from=builder /etc/config.toml /etc/config.toml
COPY --from=builder /usr/local/bin/dumb-init /usr/local/bin/dumb-init
# COPY --from=builder /tmp/percona-toolkit.tar.gz /tmp/percona-toolkit.tar.gz
COPY --from=builder /tmp/pt-online-schema-change /usr/local/bin/pt-online-schema-change
COPY --from=builder /tmp/gh-ost /usr/local/bin/gh-ost
WORKDIR /
EXPOSE 4000
ENV LANG="en_US.UTF-8"
ENV TZ=Asia/Shanghai
# ENV PERCONA_TOOLKIT_VERSION 3.0.4
# && wget -O /tmp/percona-toolkit.tar.gz https://www.percona.com/downloads/percona-toolkit/${PERCONA_TOOLKIT_VERSION}/source/tarball/percona-toolkit-${PERCONA_TOOLKIT_VERSION}.tar.gz \
#RUN set -x \
# && apk add --no-cache perl perl-dbi perl-dbd-mysql perl-io-socket-ssl perl-term-readkey make tzdata \
# && tar -xzvf /tmp/percona-toolkit.tar.gz -C /tmp \
# && cd /tmp/percona-toolkit-${PERCONA_TOOLKIT_VERSION} \
# && perl Makefile.PL \
# && make \
# && make test \
# && make install \
# && apk del make \
# && rm -rf /var/cache/apk/* /tmp/percona-toolkit*
RUN set -x \
&& apk add --no-cache --force-overwrite perl perl-dbi perl-dbd-mysql perl-io-socket-ssl perl-term-readkey tzdata /glibc.apk \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& chmod +x /usr/local/bin/pt-online-schema-change \
&& chmod +x /usr/local/bin/gh-ost \
&& apk fix --force-overwrite alpine-baselayout-data
ENTRYPOINT ["/usr/local/bin/dumb-init", "/goInception","--config=/etc/config.toml"]