forked from pingcap/tiflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-test.Dockerfile
More file actions
83 lines (68 loc) · 2.14 KB
/
integration-test.Dockerfile
File metadata and controls
83 lines (68 loc) · 2.14 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Specify the image architecture explicitly,
# otherwise it will not work correctly on other architectures.
FROM amd64/centos:centos7 as downloader
ARG BRANCH
ENV BRANCH=$BRANCH
ARG COMMUNITY
ENV COMMUNITY=$COMMUNITY
ARG VERSION
ENV VERSION=$VERSION
ARG OS
ENV OS=$OS
ARG ARCH
ENV ARCH=$ARCH
USER root
WORKDIR /root/download
# Installing dependencies.
RUN yum install -y \
wget
COPY ./scripts/download-integration-test-binaries.sh .
# Download all binaries into bin dir.
RUN ./download-integration-test-binaries.sh $BRANCH $COMMUNITY $VERSION $OS $ARCH
RUN ls ./bin
# Download go into /usr/local dir.
ENV GOLANG_VERSION 1.23.0
ENV GOLANG_DOWNLOAD_URL https://dl.google.com/go/go$GOLANG_VERSION.linux-amd64.tar.gz
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
FROM amd64/centos:centos7
USER root
WORKDIR /root
# Installing dependencies.
RUN yum install -y \
git \
bash-completion \
wget \
which \
gcc \
make \
curl \
tar \
musl-dev \
sudo \
python3 \
psmisc \
procps
RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install -y epel-release-latest-7.noarch.rpm
RUN yum --enablerepo=epel install -y s3cmd
# Install mysql client.
RUN rpm -ivh https://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
# See: https://support.cpanel.net/hc/en-us/articles/4419382481815?input_string=gpg+keys+problem+with+mysql+5.7
RUN rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
RUN yum install mysql-community-client.x86_64 -y
# install java to run the schema regsitry for the avro case.
RUN yum install -y \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel
# Copy go form downloader.
COPY --from=downloader /usr/local/go /usr/local/go
ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
WORKDIR /go/src/github.com/pingcap/tiflow
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build,target=/go/pkg/mod make integration_test_build cdc
COPY --from=downloader /root/download/bin/* ./bin/
RUN --mount=type=cache,target=/root/.cache/go-build,target=/go/pkg/mod make check_third_party_binary