github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/deployments/ticdc/docker/integration-test.Dockerfile (about)

     1  # Specify the image architecture explicitly,
     2  # otherwise it will not work correctly on other architectures.
     3  FROM amd64/centos:centos7 as downloader
     4  
     5  ARG BRANCH
     6  ENV BRANCH=$BRANCH
     7  
     8  ARG COMMUNITY
     9  ENV COMMUNITY=$COMMUNITY
    10  
    11  ARG VERSION
    12  ENV VERSION=$VERSION
    13  
    14  ARG OS
    15  ENV OS=$OS
    16  
    17  ARG ARCH
    18  ENV ARCH=$ARCH
    19  
    20  USER root
    21  WORKDIR /root/download
    22  
    23  # Installing dependencies.
    24  RUN yum install -y \
    25  	wget
    26  COPY ./scripts/download-integration-test-binaries.sh .
    27  # Download all binaries into bin dir.
    28  RUN ./download-integration-test-binaries.sh $BRANCH $COMMUNITY $VERSION $OS $ARCH
    29  RUN ls ./bin
    30  
    31  # Download go into /usr/local dir.
    32  ENV GOLANG_VERSION 1.21.0
    33  ENV GOLANG_DOWNLOAD_URL https://dl.google.com/go/go$GOLANG_VERSION.linux-amd64.tar.gz
    34  RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
    35  	&& tar -C /usr/local -xzf golang.tar.gz \
    36  	&& rm golang.tar.gz
    37  
    38  FROM amd64/centos:centos7
    39  
    40  USER root
    41  WORKDIR /root
    42  
    43  # Installing dependencies.
    44  RUN yum install -y \
    45  	git \
    46  	bash-completion \
    47  	wget \
    48      which \
    49  	gcc \
    50  	make \
    51      curl \
    52      tar \
    53      musl-dev \
    54  	sudo \
    55  	python3 \
    56      psmisc \
    57      procps
    58  RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    59  RUN yum install -y epel-release-latest-7.noarch.rpm
    60  RUN yum --enablerepo=epel install -y s3cmd
    61  # Install mysql client.
    62  RUN rpm -ivh https://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
    63  # See: https://support.cpanel.net/hc/en-us/articles/4419382481815?input_string=gpg+keys+problem+with+mysql+5.7
    64  RUN rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
    65  RUN yum install mysql-community-client.x86_64 -y
    66  
    67  # install java to run the schema regsitry for the avro case.
    68  RUN yum install -y \
    69      java-1.8.0-openjdk \
    70      java-1.8.0-openjdk-devel
    71  
    72  # Copy go form downloader.
    73  COPY --from=downloader /usr/local/go /usr/local/go
    74  ENV GOPATH /go
    75  ENV GOROOT /usr/local/go
    76  ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
    77  
    78  WORKDIR /go/src/github.com/pingcap/tiflow
    79  COPY . .
    80  
    81  RUN --mount=type=cache,target=/root/.cache/go-build,target=/go/pkg/mod make integration_test_build cdc
    82  COPY --from=downloader /root/download/bin/* ./bin/
    83  RUN --mount=type=cache,target=/root/.cache/go-build,target=/go/pkg/mod make check_third_party_binary