国产系统Kylin麒麟ARM适配

可以当他是centos

1
2
uname -a
***.ky10.aarch64

docker

https://blog.csdn.net/LG_15011399296/article/details/126119349

正常来说,可以从仓库下载但是国产系统那会正常。。。

修改仓库目录/etc/yum.repos.d因为通过$releasever确定版本而$releasever=10,centos哪有10

1
2
3
4
5
6
7
yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
    
Example:

baseurl=https://download.docker.com/linux/centos/$releasever/source/nightly

可以通过package直接装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
wget https://download.docker.com/linux/centos/8/aarch64/stable/Packages/containerd.io-1.4.3-3.1.el8.aarch64.rpm
wget https://download.docker.com/linux/centos/8/aarch64/stable/Packages/docker-ce-cli-19.03.14-3.el8.aarch64.rpm
wget https://download.docker.com/linux/centos/8/aarch64/stable/Packages/docker-ce-19.03.14-3.el8.aarch64.rpm


rpm -ivh container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
yum install -y containerd.io-1.4.3-3.1.el8.aarch64.rpm
yum install -y docker-ce-cli-19.03.14-3.el8.aarch64.rpm
yum install -y docker-ce-19.03.14-3.el8.aarch64.rpm

systemctl start docker
systemctl enable docker

docker info

docker-compose

arm 版的找不到官方的。。。。

https://github.com/zhangguanzhang/docker-compose-aarch64/releases

其他组件

arm-sources.list

1
2
3
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse

clickhouse

https://clickhouse.com/docs/en/getting-started/install/#from-binaries-non-linux

下载下来可以当server和client

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM ubuntu:18.04


COPY clickhouse /usr/bin/clickhouse-server

RUN chmod +x /usr/bin/clickhouse-server \
    && cp /usr/bin/clickhouse-server /usr/bin/clickhouse-client

ENV TZ=UTC
EXPOSE 8123 9000 9009
ENV CLICKHOUSE_CONFIG=/etc/clickhouse-server/config.xml


COPY arm-sources.list /etc/apt/sources.list
RUN apt-get update \
    && apt-get install -y --no-install-recommends wget gosu \
    && rm -rf /var/lib/apt/lists/*




ENTRYPOINT ["/entrypoint.sh"]

原entrypoint,会有个程序clickhouse读取config.yml的配置,现在简单的话直接手填

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
#!/bin/bash

....

# set some vars
CLICKHOUSE_CONFIG="${CLICKHOUSE_CONFIG:-/etc/clickhouse-server/config.xml}"

# port is needed to check if clickhouse-server is ready for connections
HTTP_PORT="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=http_port)"
TCP_PORT="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=tcp_port)"

# get CH directories locations
DATA_DIR="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=path || true)"
TMP_DIR="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=tmp_path || true)"
USER_PATH="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=user_files_path || true)"
LOG_PATH="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=logger.log || true)"
LOG_DIR="$(dirname $LOG_PATH || true)"
ERROR_LOG_PATH="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=logger.errorlog || true)"
ERROR_LOG_DIR="$(dirname $ERROR_LOG_PATH || true)"
FORMAT_SCHEMA_PATH="$(clickhouse extract-from-config --config-file $CLICKHOUSE_CONFIG --key=format_schema_path || true)"

CLICKHOUSE_USER="${CLICKHOUSE_USER:-default}"
CLICKHOUSE_PASSWORD="${CLICKHOUSE_PASSWORD:-}"
CLICKHOUSE_DB="${CLICKHOUSE_DB:-}"


kafka

又没有官方 [下载二进制包]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
FROM ubuntu:18.04

ADD sources.list /etc/apt/sources.list
# 安装 kafka 运行依赖
RUN apt update \
    && apt upgrade -y \
    && apt install -y default-jre curl \
    && rm -rf /var/lib/apt/lists/*

# 下载解压 kafka 二进制包
COPY kafka_2.13-2.8.0.tgz kafka.tgz
RUN mkdir /kafka \
    && tar -zxvf kafka.tgz -C /kafka --strip 1 \
    && rm -f kafka.tgz

WORKDIR /kafka

CMD ["./bin/kafka-server-start.sh", "./config/server.properties"]

zookeeper

有现成的但是很怪

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM ubuntu:18.04

ADD sources.list /etc/apt/sources.list
# 安装 kafka 运行依赖
RUN apt update \
    && apt upgrade -y \
    && apt install -y default-jre curl \
    && rm -rf /var/lib/apt/lists/*

# 下载解压 kafka 二进制包
COPY apache-zookeeper-3.6.3-bin.tar.gz zookeeper.tar.gz
RUN mkdir /zookeeper \
    && tar -zxvf zookeeper.tar.gz -C /zookeeper --strip 1 \
    && cp /zookeeper/conf/zoo_sample.cfg /zookeeper/conf/zoo.cfg \
    && rm zookeeper.tar.gz \
    && rm -f zookeeper.tar.gz

WORKDIR /zookeeper

CMD ["./bin/zkServer.sh", "start-foreground", "./conf/zoo.cfg"]