首先,下载etcd代码
mkdir -p $GOPATH/src/github.com/coreos
cd $GOPATH/src/github.com/coreos
git clone https://github.com/etcd-io/etcd.git
cd etcd
git chechout v3.3.15
make build
如果在arm64环境下,出现如下结果,说明成功
2020-08-20 18:05:34.183276 E | etcdmain: etcd on unsupported platform without ETCD_UNSUPPORTED_ARCH=arm64 set.
make: *** [build] 错误 1
之后,修改Dockerfile-release.arm64为如下内容:
FROM aarch64/ubuntu:16.04
ENV ETCD_UNSUPPORTED_ARCH arm64ADD bin/etcd /usr/local/bin/
ADD bin/etcdctl /usr/local/bin/
RUN mkdir /var/etcd
RUN mkdir -p /var/lib/etcdEXPOSE 2379 2380# Define default command.
CMD ["/usr/local/bin/etcd"]
最后执行如下命令:
docker build -t rancher/coreos-etcd:v3.3.15 -f Dockerfile-release.arm64 .