Build the Filebeat Docker Image for ppc64le architecture
I have a multi-architecture Kubernetes cluster across x86–64 and ppc64le platforms, and I need the Filebeat Docker image since I run the Elastic stack for log management. However, there is no official Docker image provided on ppc64le architecture, thus I have to build it myself.
Here is how to do it on a Red Hat Enterprise Linux 7.6 server running on ppc64le platform.
Install the necessary software packages.
yum install -y golang make git
Prepare the required environment.
mkdir go
export GOPATH=$(pwd)/go
mkdir -p ${GOPATH}/src/github.com/elastic
cd ${GOPATH}/src/github.com/elastic
Clone the Git repository of Elastic Beats.
git clone https://github.com/elastic/beats.git
Checkout the desired version.
cd $GOPATH/src/github.com/elastic/beats/filebeat
git checkout v7.11.1
Now it is good to go for compilation.
make
Prepare the Dockerfile.
cat <<EOF > Dockerfile
FROM centos:8
RUN yum -y update
ENV PATH="/usr/share/filebeat:${PATH}"
COPY ./filebeat-ppc64le /usr/share/filebeat
WORKDIR /usr/share/filebeat
ENTRYPOINT ["filebeat"]
EOF
Wrap the files for copying into the Docker image.
mkdir -p filebeat-ppc64le/data filebeat-ppc64le/logs
cp -p filebeat ./filebeat-ppc64le
cp -p filebeat.docker.yml ./filebeat-ppc64le/filebeat.yml
cp -p filebeat.reference.yml ./filebeat-ppc64le
cp -p README.md ./filebeat-ppc64le
cp -pR module ./filebeat-ppc64le
cp -pR modules.d ./filebeat-ppc64le
Build the Docker image.
docker build -t beats/filebeat-ppc64le:7.11.1 .
You should now have the Filebeat Docker image successfully built for ppc64le platform.