diff --git a/.gitignore b/.gitignore index 99985c343e..d21332a8f8 100755 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,7 @@ test/client/configs/* projects/* docker/curvebs docker/base/* +docker/debian*/*so* !docker/base/Dockerfile !docker/base/Makefile @@ -107,6 +108,7 @@ curvefs/monitor/prometheus/target.json curvefs/docker/*/curvefs curvefs/docker/curvefs curvefs/docker/base/* +curvefs/docker/debian*/*so* !curvefs/docker/base/Dockerfile !curvefs/docker/base/Makefile curvefs/BUILD_MODE diff --git a/curvefs/docker/debian10/Dockerfile b/curvefs/docker/debian10/Dockerfile deleted file mode 100644 index 55ca2e714d..0000000000 --- a/curvefs/docker/debian10/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM opencurvedocker/curve-base:debian10 -ENV TZ=Asia/Shanghai -RUN mkdir -p /curvefs /etc/curvefs /core /etc/curve -COPY curvefs /curvefs -COPY entrypoint.sh / -COPY curvefs/tools/sbin/curvefs_tool /usr/bin -COPY libmemcached.so /usr/lib/ -COPY libmemcached.so.11 /usr/lib/ -COPY libhashkit.so.2 /usr/lib -RUN chmod a+x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/curvefs/docker/debian10/base/Dockerfile b/curvefs/docker/debian10/base/Dockerfile deleted file mode 100644 index 9dee0a09ad..0000000000 --- a/curvefs/docker/debian10/base/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM opencurvedocker/curve-base:debian10 - -RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - gcc \ - gdb \ - make \ - openssl \ - net-tools \ - libcurl3-gnutls \ - perl \ - linux-perf \ - vim \ - curl \ - cron \ - procps \ - lsof \ - nginx \ - less \ - fuse3 \ - libnl-3-200 \ - libnl-genl-3-200 \ - libjemalloc2 \ - libsnappy1v5 \ - liblz4-1 \ - zlib1g \ - && ln -sf /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so - -COPY libetcdclient.so /usr/lib/ diff --git a/curvefs/docker/debian10/base/Makefile b/curvefs/docker/debian10/base/Makefile deleted file mode 100644 index 76b6029c7b..0000000000 --- a/curvefs/docker/debian10/base/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:debian10 . diff --git a/curvefs/docker/debian10/compile/Dockerfile b/curvefs/docker/debian10/compile/Dockerfile deleted file mode 100644 index e9c759ffc3..0000000000 --- a/curvefs/docker/debian10/compile/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM opencurvedocker/curve-base:build-debian10 - -RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - wget \ - git \ - gcc \ - g++ \ - clang \ - libssl-dev \ - libnl-genl-3-dev \ - libcurl4-gnutls-dev \ - uuid-dev \ - libfiu-dev \ - libfuse3-dev \ - zlib1g-dev \ - make \ - openjdk-11-jdk \ - sudo \ - zlib1g-dev \ - libsnappy-dev \ - liblz4-dev \ - cmake \ - ca-certificates \ - curl \ - gnupg \ - lsb-release \ - curl \ - git \ - && mkdir -p /etc/apt/keyrings \ - && curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \ - && apt-get update \ - && apt-get install -y docker-ce docker-ce-cli containerd.io \ - && wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \ - && mv bazelisk-linux-amd64 /usr/bin/bazelisk \ - && ln -sf /usr/bin/bazelisk /usr/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-linux-x86_64 \ - && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin \ - && mv bazel-4.2.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel \ - && chmod +x /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel /usr/bin/bazel /usr/bin/bazelisk diff --git a/curvefs/docker/debian10/compile/Makefile b/curvefs/docker/debian10/compile/Makefile deleted file mode 100644 index 09ce5bc7fb..0000000000 --- a/curvefs/docker/debian10/compile/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:build-debian10 . diff --git a/curvefs/docker/debian10/entrypoint.sh b/curvefs/docker/debian10/entrypoint.sh deleted file mode 100755 index 623b6133ad..0000000000 --- a/curvefs/docker/debian10/entrypoint.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2021 Jingli Chen (Wine93), NetEase Inc. - -############################ GLOBAL VARIABLES -g_role="" -g_args="" -g_prefix="" -g_binary="" -g_start_args="" - -############################ BASIC FUNCTIONS -function msg() { - printf '%b' "$1" >&2 -} - -function success() { - msg "\33[32m[✔]\33[0m ${1}${2}" -} - -function die() { - msg "\33[31m[✘]\33[0m ${1}${2}" - exit 1 -} - -############################ FUNCTIONS -function usage () { - cat << _EOC_ -Usage: - entrypoint.sh --role=ROLE - entrypoint.sh --role=ROLE --args=ARGS - -Examples: - entrypoint.sh --role=etcd - entrypoint.sh --role=client --args="-o default_permissions" -_EOC_ -} - -function get_options() { - local long_opts="role:,args:,help" - local args=`getopt -o ra --long $long_opts -n "$0" -- "$@"` - eval set -- "${args}" - while true - do - case "$1" in - -r|--role) - g_role=$2 - shift 2 - ;; - -a|--args) - g_args=$2 - shift 2 - ;; - -h) - usage - exit 1 - ;; - --) - shift - break - ;; - *) - exit 1 - ;; - esac - done -} - -function prepare() { - g_prefix="/curvefs/$g_role" - conf_path="$g_prefix/conf/$g_role.conf" - - case $g_role in - etcd) - g_binary="$g_prefix/sbin/etcd" - g_start_args="--config-file $conf_path" - ;; - mds) - g_binary="$g_prefix/sbin/curvefs-mds" - g_start_args="--confPath $conf_path" - ;; - metaserver) - g_binary="$g_prefix/sbin/curvefs-metaserver" - g_start_args="--confPath $conf_path" - ;; - client) - g_binary="$g_prefix/sbin/curve-fuse" - g_start_args="--confPath $conf_path" - ;; - *) - usage - exit 1 - ;; - esac - - if [ "$g_args" != "" ]; then - g_start_args=$g_args - fi -} - -function create_directory() { - chmod 700 "$g_prefix/data" - if [ "$g_role" == "etcd" ]; then - mkdir -p "$g_prefix/data/wal" - elif [ "$g_role" == "metaserver" ]; then - mkdir -p "$g_prefix/data/storage" - elif [ "$g_role" == "client" ]; then - mkdir -p "$g_prefix/mnt" - fi -} - -function main() { - get_options "$@" - - prepare - create_directory - [[ $(command -v crontab) ]] && cron - if [ $g_role == "etcd" ]; then - exec $g_binary $g_start_args >>$g_prefix/logs/etcd.log 2>&1 - else - exec $g_binary $g_start_args - fi -} - -############################ MAIN() -main "$@" diff --git a/curvefs/docker/debian11/Dockerfile b/curvefs/docker/debian11/Dockerfile deleted file mode 100644 index a451fda653..0000000000 --- a/curvefs/docker/debian11/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM opencurvedocker/curve-base:debian11 -ENV TZ=Asia/Shanghai -RUN mkdir -p /curvefs /etc/curvefs /core /etc/curve -COPY curvefs /curvefs -COPY entrypoint.sh / -COPY curvefs/tools/sbin/curvefs_tool /usr/bin -COPY libmemcached.so /usr/lib/ -COPY libmemcached.so.11 /usr/lib/ -COPY libhashkit.so.2 /usr/lib -RUN chmod a+x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/curvefs/docker/debian11/base/Dockerfile b/curvefs/docker/debian11/base/Dockerfile deleted file mode 100644 index 19c74f896e..0000000000 --- a/curvefs/docker/debian11/base/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM opencurvedocker/curve-base:debian11 - -RUN echo "deb http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - gcc \ - gdb \ - make \ - openssl \ - net-tools \ - libcurl3-gnutls \ - perl \ - linux-perf \ - vim \ - curl \ - cron \ - procps \ - lsof \ - nginx \ - less \ - fuse3 \ - libnl-3-200 \ - libnl-genl-3-200 \ - libjemalloc2 \ - libsnappy1v5 \ - liblz4-1 \ - zlib1g - && ln -sf /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so - -COPY libetcdclient.so /usr/lib/ diff --git a/curvefs/docker/debian11/base/Makefile b/curvefs/docker/debian11/base/Makefile deleted file mode 100644 index a06c7cb1a1..0000000000 --- a/curvefs/docker/debian11/base/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:debian11 . diff --git a/curvefs/docker/debian11/compile/Dockerfile b/curvefs/docker/debian11/compile/Dockerfile deleted file mode 100644 index 0ebfee2c03..0000000000 --- a/curvefs/docker/debian11/compile/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -FROM opencurvedocker/curve-base:build-debian11 - -RUN echo "deb http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - wget \ - git \ - gcc \ - g++ \ - clang \ - libssl-dev \ - libnl-genl-3-dev \ - libcurl4-gnutls-dev \ - uuid-dev \ - libfiu-dev \ - libfuse3-dev \ - zlib1g-dev \ - make \ - openjdk-11-jdk \ - sudo \ - libsnappy-dev \ - liblz4-dev \ - cmake \ - ca-certificates \ - curl \ - gnupg \ - lsb-release \ - curl \ - git \ - && mkdir -p /etc/apt/keyrings \ - # && curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \ - && apt-get update \ - && apt-get install -y docker-ce docker-ce-cli containerd.io \ - && wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \ - && mv bazelisk-linux-amd64 /usr/bin/bazelisk \ - && ln -sf /usr/bin/bazelisk /usr/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-linux-x86_64 \ - && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin \ - && mv bazel-4.2.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel \ - && chmod +x /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel /usr/bin/bazel /usr/bin/bazelisk diff --git a/curvefs/docker/debian11/compile/Makefile b/curvefs/docker/debian11/compile/Makefile deleted file mode 100644 index fc22be12cb..0000000000 --- a/curvefs/docker/debian11/compile/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:build-debian11 . diff --git a/curvefs/docker/debian11/entrypoint.sh b/curvefs/docker/debian11/entrypoint.sh deleted file mode 100755 index 623b6133ad..0000000000 --- a/curvefs/docker/debian11/entrypoint.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2021 Jingli Chen (Wine93), NetEase Inc. - -############################ GLOBAL VARIABLES -g_role="" -g_args="" -g_prefix="" -g_binary="" -g_start_args="" - -############################ BASIC FUNCTIONS -function msg() { - printf '%b' "$1" >&2 -} - -function success() { - msg "\33[32m[✔]\33[0m ${1}${2}" -} - -function die() { - msg "\33[31m[✘]\33[0m ${1}${2}" - exit 1 -} - -############################ FUNCTIONS -function usage () { - cat << _EOC_ -Usage: - entrypoint.sh --role=ROLE - entrypoint.sh --role=ROLE --args=ARGS - -Examples: - entrypoint.sh --role=etcd - entrypoint.sh --role=client --args="-o default_permissions" -_EOC_ -} - -function get_options() { - local long_opts="role:,args:,help" - local args=`getopt -o ra --long $long_opts -n "$0" -- "$@"` - eval set -- "${args}" - while true - do - case "$1" in - -r|--role) - g_role=$2 - shift 2 - ;; - -a|--args) - g_args=$2 - shift 2 - ;; - -h) - usage - exit 1 - ;; - --) - shift - break - ;; - *) - exit 1 - ;; - esac - done -} - -function prepare() { - g_prefix="/curvefs/$g_role" - conf_path="$g_prefix/conf/$g_role.conf" - - case $g_role in - etcd) - g_binary="$g_prefix/sbin/etcd" - g_start_args="--config-file $conf_path" - ;; - mds) - g_binary="$g_prefix/sbin/curvefs-mds" - g_start_args="--confPath $conf_path" - ;; - metaserver) - g_binary="$g_prefix/sbin/curvefs-metaserver" - g_start_args="--confPath $conf_path" - ;; - client) - g_binary="$g_prefix/sbin/curve-fuse" - g_start_args="--confPath $conf_path" - ;; - *) - usage - exit 1 - ;; - esac - - if [ "$g_args" != "" ]; then - g_start_args=$g_args - fi -} - -function create_directory() { - chmod 700 "$g_prefix/data" - if [ "$g_role" == "etcd" ]; then - mkdir -p "$g_prefix/data/wal" - elif [ "$g_role" == "metaserver" ]; then - mkdir -p "$g_prefix/data/storage" - elif [ "$g_role" == "client" ]; then - mkdir -p "$g_prefix/mnt" - fi -} - -function main() { - get_options "$@" - - prepare - create_directory - [[ $(command -v crontab) ]] && cron - if [ $g_role == "etcd" ]; then - exec $g_binary $g_start_args >>$g_prefix/logs/etcd.log 2>&1 - else - exec $g_binary $g_start_args - fi -} - -############################ MAIN() -main "$@" diff --git a/curvefs/docker/debian9/Dockerfile b/curvefs/docker/debian9/Dockerfile index 8e49b7d673..da2221097f 100644 --- a/curvefs/docker/debian9/Dockerfile +++ b/curvefs/docker/debian9/Dockerfile @@ -1,11 +1,15 @@ FROM opencurvedocker/curve-base:debian9 ENV TZ=Asia/Shanghai RUN mkdir -p /curvefs /etc/curvefs /core /etc/curve -COPY curvefs /curvefs +COPY curvefs/client /curvefs/client +COPY curvefs/conf /curvefs/conf +COPY curvefs/etcd /curvefs/etcd +COPY curvefs/mds /curvefs/mds +COPY curvefs/metaserver /curvefs/metaserver +COPY curvefs/monitor /curvefs/monitor +COPY curvefs/tools /curvefs/tools COPY entrypoint.sh / COPY curvefs/tools/sbin/curvefs_tool /usr/bin -COPY libmemcached.so /usr/lib/ -COPY libmemcached.so.11 /usr/lib/ -COPY libhashkit.so.2 /usr/lib +COPY libmemcached.so libmemcached.so.11 libhashkit.so.2 /usr/lib/ RUN chmod a+x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/curvefs/docker/debian9/base/Dockerfile b/curvefs/docker/debian9/base/Dockerfile deleted file mode 100644 index 39c37079d7..0000000000 --- a/curvefs/docker/debian9/base/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM opencurvedocker/curve-base:debian9 - -RUN echo "deb http://mirrors.163.com/debian/ stretch main\n" \ - "deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib\n" \ - "deb http://httpredir.debian.org/debian stretch-backports main contrib non-free\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - gcc \ - gdb \ - make \ - openssl \ - net-tools \ - libcurl3-gnutls \ - podlators-perl \ - linux-perf \ - vim \ - curl \ - cron \ - procps \ - lsof \ - nginx \ - less \ - zlib1g \ - libsnappy1v5 \ - liblz4-1 \ - python \ - wget \ - python3 \ - && wget https://curve-build.nos-eastchina1.126.net/curve-base.tar.gz \ - && tar -xzvf curve-base.tar.gz -COPY fusermount3 /usr/local/bin -COPY libetcdclient.so /usr/lib/ -COPY libfuse3.so libfuse3.so.3 libfuse3.so.3.10.5 libnl-3.so.200 libnl-genl-3.so.200 /usr/lib/x86_64-linux-gnu/ -COPY libjemalloc.so libjemalloc.so.1 libjemalloc.so.2 /usr/local/lib/ diff --git a/curvefs/docker/debian9/base/Makefile b/curvefs/docker/debian9/base/Makefile deleted file mode 100644 index 12f8cbad18..0000000000 --- a/curvefs/docker/debian9/base/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:debian9 . diff --git a/curvefs/docker/debian9/compile/Dockerfile b/curvefs/docker/debian9/compile/Dockerfile deleted file mode 100644 index 07b7cf63c8..0000000000 --- a/curvefs/docker/debian9/compile/Dockerfile +++ /dev/null @@ -1,50 +0,0 @@ -FROM opencurvedocker/curve-base:build-debian9 - -RUN apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - g++ \ - wget \ - clang \ - git \ - libnl-genl-3-dev \ - libssl-dev \ - uuid-dev \ - libcurl4-gnutls-dev \ - libfiu-dev \ - openjdk-8-jdk \ - sudo \ - python-dev \ - python-setuptools \ - python-wheel \ - python3-dev \ - python3-setuptools \ - python3-wheel \ - zlib1g-dev \ - libsnappy-dev \ - liblz4-dev \ - cmake \ - ca-certificates \ - curl \ - gnupg \ - lsb-release \ - curl \ - apt-transport-https \ - git \ - && mkdir -p /etc/apt/keyrings \ - && curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \ - && apt-get update \ - && apt-get install -y docker-ce docker-ce-cli containerd.io \ - && wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \ - && mv bazelisk-linux-amd64 /usr/bin/bazelisk \ - && ln -sf /usr/bin/bazelisk /usr/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-linux-x86_64 \ - && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin \ - && mv bazel-4.2.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-linux-x86_64 \ - && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-0.17.2-linux-x86_64/bin \ - && mv bazel-0.17.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-0.17.2-linux-x86_64/bin/bazel \ - && chmod +x /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel /root/.cache/bazelisk/downloads/bazelbuild/bazel-0.17.2-linux-x86_64/bin/bazel /usr/bin/bazel /usr/bin/bazelisk -COPY fuse3/* /usr/include/fuse3/ diff --git a/curvefs/docker/debian9/compile/Makefile b/curvefs/docker/debian9/compile/Makefile deleted file mode 100644 index e6eaf82596..0000000000 --- a/curvefs/docker/debian9/compile/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:build-debian9 . diff --git a/curvefs/docker/debian9/entrypoint.sh b/curvefs/docker/debian9/entrypoint.sh index e95e09ed6d..62a8700fa8 100755 --- a/curvefs/docker/debian9/entrypoint.sh +++ b/curvefs/docker/debian9/entrypoint.sh @@ -91,6 +91,10 @@ function prepare() { g_binary="python3" g_start_args="target_json.py" ;; + memcached) + g_prefix="/memcached" + g_binary="memcached" + ;; *) usage exit 1 diff --git a/curvefs/src/client/main.cpp b/curvefs/src/client/main.cpp index 59034b97b6..92739b18e0 100644 --- a/curvefs/src/client/main.cpp +++ b/curvefs/src/client/main.cpp @@ -21,7 +21,9 @@ * Author: xuchaojie */ +#include #include + #include "curvefs/src/client/curve_fuse_op.h" #include "curvefs/src/client/fuse_common.h" diff --git a/curvefs/src/mds/topology/topology_storge_etcd.cpp b/curvefs/src/mds/topology/topology_storge_etcd.cpp index f186105324..2b3708bb36 100644 --- a/curvefs/src/mds/topology/topology_storge_etcd.cpp +++ b/curvefs/src/mds/topology/topology_storge_etcd.cpp @@ -28,6 +28,7 @@ #include #include "curvefs/src/mds/common/mds_define.h" #include "curvefs/src/mds/common/storage_key.h" +#include "src/common/string_util.h" namespace curvefs { namespace mds { @@ -632,10 +633,10 @@ bool TopologyStorageEtcd::LoadFs2MemcacheCluster( // Duplicated id return false; } - try { - fs2MemcacheCluster->emplace(id, std::stoul(data.second)); - } catch (std::exception) { - // for std::stoul(data.second) exceptions + FsIdType fsId; + if (curve::common::StringToUl(data.second, &fsId)) { + fs2MemcacheCluster->emplace(id, fsId); + } else { return false; } } diff --git a/docker/debian10/Dockerfile b/docker/debian10/Dockerfile deleted file mode 100644 index b64ae8d452..0000000000 --- a/docker/debian10/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM opencurvedocker/curve-base:debian10 -ENV TZ=Asia/Shanghai -RUN mkdir -p /curvebs /etc/curve /etc/nebd /core -COPY curvebs /curvebs -COPY entrypoint.sh / -COPY curvebs/tools/sbin/curve_ops_tool curvebs/nbd/sbin/curve-nbd /usr/bin/ -RUN chmod a+x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/debian10/base/Dockerfile b/docker/debian10/base/Dockerfile deleted file mode 100644 index 608f3e21c6..0000000000 --- a/docker/debian10/base/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM debian:10 - -RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - gcc \ - gdb \ - make \ - openssl \ - net-tools \ - libcurl3-gnutls \ - perl \ - linux-perf \ - vim \ - curl \ - cron \ - procps \ - lsof \ - nginx \ - less \ - fuse \ - libnl-3-200 \ - libnl-genl-3-200 \ - libjemalloc2 - -COPY libetcdclient.so /usr/lib/ diff --git a/docker/debian10/base/Makefile b/docker/debian10/base/Makefile deleted file mode 100644 index 76b6029c7b..0000000000 --- a/docker/debian10/base/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:debian10 . diff --git a/docker/debian10/compile/Dockerfile b/docker/debian10/compile/Dockerfile deleted file mode 100644 index 7d9c36d9a8..0000000000 --- a/docker/debian10/compile/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM debian:10 - -RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - wget \ - git \ - gcc \ - g++ \ - clang \ - libssl-dev \ - libnl-genl-3-dev \ - libcurl4-gnutls-dev \ - uuid-dev \ - libfiu-dev \ - libfuse3-dev \ - zlib1g-dev \ - make \ - openjdk-11-jdk \ - sudo \ - && wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \ - && mv bazelisk-linux-amd64 /usr/bin/bazelisk \ - && ln -s /usr/bin/bazelisk /usr/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-linux-x86_64 \ - && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin \ - && mv bazel-4.2.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel \ - && chmod +x /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel /usr/bin/bazel /usr/bin/bazelisk diff --git a/docker/debian10/compile/Makefile b/docker/debian10/compile/Makefile deleted file mode 100644 index 09ce5bc7fb..0000000000 --- a/docker/debian10/compile/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:build-debian10 . diff --git a/docker/debian10/entrypoint.sh b/docker/debian10/entrypoint.sh deleted file mode 100644 index 30c7bba688..0000000000 --- a/docker/debian10/entrypoint.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2021 Jingli Chen (Wine93), NetEase Inc. - -############################ GLOBAL VARIABLES -g_role="" -g_args="" -g_prefix="" -g_preexec="" -g_binary="" -g_start_args="" - -############################ BASIC FUNCTIONS -function msg() { - printf '%b' "$1" >&2 -} - -function success() { - msg "\33[32m[✔]\33[0m ${1}${2}" -} - -function die() { - msg "\33[31m[✘]\33[0m ${1}${2}" - exit 1 -} - -############################ FUNCTIONS -function usage () { - cat << _EOC_ -Usage: - entrypoint.sh --role=ROLE - entrypoint.sh --role=ROLE --args=ARGS - -Examples: - entrypoint.sh --role=etcd - entrypoint.sh --role=client --args="-o default_permissions" -_EOC_ -} - -function get_options() { - local long_opts="role:,args:,help" - local args=`getopt -o ra --long $long_opts -n "$0" -- "$@"` - eval set -- "${args}" - while true - do - case "$1" in - -r|--role) - g_role=$2 - shift 2 - ;; - -a|--args) - g_args=$2 - shift 2 - ;; - -h) - usage - exit 1 - ;; - --) - shift - break - ;; - *) - exit 1 - ;; - esac - done -} - -function prepare() { - g_prefix="/curvebs/$g_role" - conf_path="$g_prefix/conf/$g_role.conf" - - case $g_role in - etcd) - g_binary="$g_prefix/sbin/etcd" - g_start_args="--config-file $conf_path" - ;; - mds) - g_binary="$g_prefix/sbin/curvebs-mds" - g_start_args="--confPath $conf_path" - ;; - chunkserver) - g_binary="$g_prefix/sbin/curvebs-chunkserver" - g_start_args="--conf=$conf_path" - ;; - snapshotclone) - g_preexec="/usr/sbin/nginx -c $g_prefix/conf/nginx.conf" - g_binary="$g_prefix/sbin/curvebs-snapshotclone" - g_start_args="--conf=$conf_path" - ;; - nebd) - g_binary="$g_prefix/sbin/nebd-server" - g_start_args="-confPath=$g_prefix/conf/nebd-server.conf -log_dir=$g_prefix/logs" - ;; - *) - usage - exit 1 - ;; - esac - - if [ "$g_args" != "" ]; then - g_start_args=$g_args - fi -} - -function create_directory() { - chmod 700 "$g_prefix/data" - if [ "$g_role" == "etcd" ]; then - mkdir -p "$g_prefix/data/wal" - elif [ "$g_role" == "client" ]; then - mkdir -p "$g_prefix/mnt" - fi -} - -function main() { - get_options "$@" - - prepare - create_directory - [[ $(command -v crontab) ]] && cron - [[ ! -z $g_preexec ]] && $g_preexec - if [ $g_role == "etcd" ]; then - exec $g_binary $g_start_args >>$g_prefix/logs/etcd.log 2>&1 - else - exec $g_binary $g_start_args - fi -} - -############################ MAIN() -main "$@" diff --git a/docker/debian11/Dockerfile b/docker/debian11/Dockerfile deleted file mode 100644 index 2edd75fecd..0000000000 --- a/docker/debian11/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM opencurvedocker/curve-base:debian11 -ENV TZ=Asia/Shanghai -RUN mkdir -p /curvebs /etc/curve /etc/nebd /core -COPY curvebs /curvebs -COPY entrypoint.sh / -COPY curvebs/tools/sbin/curve_ops_tool curvebs/nbd/sbin/curve-nbd /usr/bin/ -RUN chmod a+x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/debian11/base/Dockerfile b/docker/debian11/base/Dockerfile deleted file mode 100644 index 2058279335..0000000000 --- a/docker/debian11/base/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM debian:11 - -RUN echo "deb http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - gcc \ - gdb \ - make \ - openssl \ - net-tools \ - libcurl3-gnutls \ - perl \ - linux-perf \ - vim \ - curl \ - cron \ - procps \ - lsof \ - nginx \ - less \ - fuse \ - libnl-3-200 \ - libnl-genl-3-200 \ - libjemalloc2 - -COPY libetcdclient.so /usr/lib/ \ No newline at end of file diff --git a/docker/debian11/base/Makefile b/docker/debian11/base/Makefile deleted file mode 100644 index a06c7cb1a1..0000000000 --- a/docker/debian11/base/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:debian11 . diff --git a/docker/debian11/compile/Dockerfile b/docker/debian11/compile/Dockerfile deleted file mode 100644 index d94d163a08..0000000000 --- a/docker/debian11/compile/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM debian:11 - -RUN echo "deb http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib\n" \ - "deb-src http://mirrors.163.com/debian-security/ stable-security main non-free contrib\n" \ - > /etc/apt/sources.list \ - && apt-get clean \ - && apt-get -y update \ - && apt-get -y install \ - wget \ - git \ - gcc \ - g++ \ - clang \ - libssl-dev \ - libnl-genl-3-dev \ - libcurl4-gnutls-dev \ - uuid-dev \ - libfiu-dev \ - libfuse3-dev \ - zlib1g-dev \ - make \ - openjdk-11-jdk \ - sudo \ - && wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \ - && mv bazelisk-linux-amd64 /usr/bin/bazelisk \ - && ln -s /usr/bin/bazelisk /usr/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-linux-x86_64 \ - && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin \ - && mv bazel-4.2.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel \ - && chmod +x /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel /usr/bin/bazel /usr/bin/bazelisk diff --git a/docker/debian11/compile/Makefile b/docker/debian11/compile/Makefile deleted file mode 100644 index fc22be12cb..0000000000 --- a/docker/debian11/compile/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -.PHONY: build - -build: - docker build -t opencurvedocker/curve-base:build-debian11 . diff --git a/docker/debian11/entrypoint.sh b/docker/debian11/entrypoint.sh deleted file mode 100644 index 30c7bba688..0000000000 --- a/docker/debian11/entrypoint.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2021 Jingli Chen (Wine93), NetEase Inc. - -############################ GLOBAL VARIABLES -g_role="" -g_args="" -g_prefix="" -g_preexec="" -g_binary="" -g_start_args="" - -############################ BASIC FUNCTIONS -function msg() { - printf '%b' "$1" >&2 -} - -function success() { - msg "\33[32m[✔]\33[0m ${1}${2}" -} - -function die() { - msg "\33[31m[✘]\33[0m ${1}${2}" - exit 1 -} - -############################ FUNCTIONS -function usage () { - cat << _EOC_ -Usage: - entrypoint.sh --role=ROLE - entrypoint.sh --role=ROLE --args=ARGS - -Examples: - entrypoint.sh --role=etcd - entrypoint.sh --role=client --args="-o default_permissions" -_EOC_ -} - -function get_options() { - local long_opts="role:,args:,help" - local args=`getopt -o ra --long $long_opts -n "$0" -- "$@"` - eval set -- "${args}" - while true - do - case "$1" in - -r|--role) - g_role=$2 - shift 2 - ;; - -a|--args) - g_args=$2 - shift 2 - ;; - -h) - usage - exit 1 - ;; - --) - shift - break - ;; - *) - exit 1 - ;; - esac - done -} - -function prepare() { - g_prefix="/curvebs/$g_role" - conf_path="$g_prefix/conf/$g_role.conf" - - case $g_role in - etcd) - g_binary="$g_prefix/sbin/etcd" - g_start_args="--config-file $conf_path" - ;; - mds) - g_binary="$g_prefix/sbin/curvebs-mds" - g_start_args="--confPath $conf_path" - ;; - chunkserver) - g_binary="$g_prefix/sbin/curvebs-chunkserver" - g_start_args="--conf=$conf_path" - ;; - snapshotclone) - g_preexec="/usr/sbin/nginx -c $g_prefix/conf/nginx.conf" - g_binary="$g_prefix/sbin/curvebs-snapshotclone" - g_start_args="--conf=$conf_path" - ;; - nebd) - g_binary="$g_prefix/sbin/nebd-server" - g_start_args="-confPath=$g_prefix/conf/nebd-server.conf -log_dir=$g_prefix/logs" - ;; - *) - usage - exit 1 - ;; - esac - - if [ "$g_args" != "" ]; then - g_start_args=$g_args - fi -} - -function create_directory() { - chmod 700 "$g_prefix/data" - if [ "$g_role" == "etcd" ]; then - mkdir -p "$g_prefix/data/wal" - elif [ "$g_role" == "client" ]; then - mkdir -p "$g_prefix/mnt" - fi -} - -function main() { - get_options "$@" - - prepare - create_directory - [[ $(command -v crontab) ]] && cron - [[ ! -z $g_preexec ]] && $g_preexec - if [ $g_role == "etcd" ]; then - exec $g_binary $g_start_args >>$g_prefix/logs/etcd.log 2>&1 - else - exec $g_binary $g_start_args - fi -} - -############################ MAIN() -main "$@" diff --git a/docker/debian9/Dockerfile b/docker/debian9/Dockerfile index b5a82cfa17..9393260db4 100644 --- a/docker/debian9/Dockerfile +++ b/docker/debian9/Dockerfile @@ -1,7 +1,16 @@ FROM opencurvedocker/curve-base:debian9 ENV TZ=Asia/Shanghai RUN mkdir -p /curvebs /etc/curve /etc/nebd /core -COPY curvebs /curvebs +COPY curvebs/chunkserver /curvebs/chunkserver +COPY curvebs/conf /curvebs/conf +COPY curvebs/etcd /curvebs/etcd +COPY curvebs/mds /curvebs/mds +COPY curvebs/monitor /curvebs/monitor +COPY curvebs/nbd /curvebs/nbd +COPY curvebs/nebd /curvebs/nebd +COPY curvebs/playground /curvebs/playground +COPY curvebs/snapshotclone /curvebs/snapshotclone +COPY curvebs/tools /curvebs/tools COPY entrypoint.sh / COPY curvebs/tools/sbin/curve_ops_tool curvebs/nbd/sbin/curve-nbd /usr/bin/ RUN chmod a+x /entrypoint.sh diff --git a/docker/debian9/base/Dockerfile b/docker/debian9/base/Dockerfile index 67e2f52228..b029cce2dd 100644 --- a/docker/debian9/base/Dockerfile +++ b/docker/debian9/base/Dockerfile @@ -24,16 +24,22 @@ RUN echo "deb http://mirrors.163.com/debian/ stretch main\n" \ lsof \ nginx \ less \ - zlib1g-dev \ - libsnappy-dev \ - liblz4-dev \ + zlib1g \ + libsnappy1v5 \ + liblz4-1 \ python \ wget \ python3 \ + libevent-dev \ + && wget https://curve-build.nos-eastchina1.126.net/memcache/memcached-1.6.17.tar.gz \ + && tar xvf memcached-1.6.17.tar.gz && cd memcached-1.6.17/ \ + && ./configure && make && make install \ + && cd / && rm -rf memcached-1.6.17/ memcached-1.6.17.tar.gz \ + && mkdir -p /memcached/data \ && wget https://curve-build.nos-eastchina1.126.net/curve-base.tar.gz \ - && tar -xzvf curve-base.tar.gz - -COPY fusermount3 /usr/local/bin -COPY libetcdclient.so /usr/lib/ -COPY libfuse3.so libfuse3.so.3 libfuse3.so.3.10.5 libnl-3.so.200 libnl-genl-3.so.200 /usr/lib/x86_64-linux-gnu/ -COPY libjemalloc.so libjemalloc.so.1 libjemalloc.so.2 /usr/local/lib/ + && tar -xzvf curve-base.tar.gz \ + && mv fusermount3 /usr/local/bin \ + && mv libetcdclient.so /usr/lib/ \ + && mv libfuse3.so libfuse3.so.3 libfuse3.so.3.10.5 libnl-3.so.200 libnl-genl-3.so.200 /usr/lib/x86_64-linux-gnu/ \ + && mv libjemalloc.so libjemalloc.so.1 libjemalloc.so.2 /usr/local/lib/ \ + && rm curve-base.tar.gz diff --git a/docker/debian9/compile/Dockerfile b/docker/debian9/compile/Dockerfile index 436353f1ae..fe0ac3151e 100644 --- a/docker/debian9/compile/Dockerfile +++ b/docker/debian9/compile/Dockerfile @@ -1,34 +1,87 @@ -FROM opencurvedocker/curve-base:debian9 +FROM debian:9 -RUN apt-get clean \ +ENV GITHUB_PROXY=https://ghproxy.com/ +ENV ETCD_VER=v3.4.0 \ + DOWNLOAD_ETCD_URL=${GITHUB_PROXY}https://github.com/etcd-io/etcd/releases/download +RUN echo "deb http://mirrors.163.com/debian/ stretch main\n" \ + "deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib\n" \ + "deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib\n" \ + "deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib\n" \ + "deb http://httpredir.debian.org/debian stretch-backports main contrib non-free\n" \ + > /etc/apt/sources.list \ + && apt-get clean \ && apt-get -y update \ && apt-get -y install \ - g++ \ - wget \ - clang \ - git \ - libnl-genl-3-dev \ - libssl-dev \ - uuid-dev \ - zlib1g-dev \ - libcurl4-gnutls-dev \ - libfiu-dev \ - openjdk-8-jdk \ - sudo \ - python-dev \ - python-setuptools \ - python-wheel \ - python3-dev \ - python3-setuptools \ - python3-wheel \ - && wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \ + g++ \ + wget \ + clang \ + git \ + libnl-genl-3-dev \ + libssl-dev \ + uuid-dev \ + libcurl4-gnutls-dev \ + libfiu-dev \ + openjdk-8-jdk \ + sudo \ + python-dev \ + python-setuptools \ + python-wheel \ + python3-dev \ + python3-setuptools \ + python3-wheel \ + zlib1g-dev \ + libsnappy-dev \ + liblz4-dev \ + ca-certificates \ + curl \ + gnupg \ + lsb-release \ + curl \ + apt-transport-https \ + git \ + libbison-dev \ + flex \ + libhashkit-dev \ + libevent-dev \ + procps \ + lsof \ + gdb \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \ + && apt-get update \ + && apt-get install -y docker-ce docker-ce-cli containerd.io \ + && wget ${GITHUB_PROXY}https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \ && mv bazelisk-linux-amd64 /usr/bin/bazelisk \ - && ln -s /usr/bin/bazelisk /usr/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-linux-x86_64 \ + && ln -sf /usr/bin/bazelisk /usr/bin/bazel \ + && wget ${GITHUB_PROXY}https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-linux-x86_64 \ && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin \ && mv bazel-4.2.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel \ - && wget https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-linux-x86_64 \ + && wget ${GITHUB_PROXY}https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-linux-x86_64 \ && mkdir -p /root/.cache/bazelisk/downloads/bazelbuild/bazel-0.17.2-linux-x86_64/bin \ && mv bazel-0.17.2-linux-x86_64 /root/.cache/bazelisk/downloads/bazelbuild/bazel-0.17.2-linux-x86_64/bin/bazel \ - && chmod +x /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel /root/.cache/bazelisk/downloads/bazelbuild/bazel-0.17.2-linux-x86_64/bin/bazel /usr/bin/bazel /usr/bin/bazelisk -COPY fuse3/* /usr/include/fuse3/ + && chmod +x /root/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.2-linux-x86_64/bin/bazel /root/.cache/bazelisk/downloads/bazelbuild/bazel-0.17.2-linux-x86_64/bin/bazel /usr/bin/bazel /usr/bin/bazelisk \ + && wget ${GITHUB_PROXY}/https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4-Linux-x86_64.tar.gz \ + && tar Cxzf /usr/share/ cmake-3.13.4-Linux-x86_64.tar.gz \ + && rm cmake-3.13.4-Linux-x86_64.tar.gz \ + && ln -s /usr/share/cmake-3.13.4-Linux-x86_64/bin/cmake /usr/bin/cmake \ + && wget https://curve-build.nos-eastchina1.126.net/fuse3.tar.gz \ + && tar Cxzf /usr/include/ fuse3.tar.gz && rm fuse3.tar.gz \ + && rm -f /usr/local/etcd-${ETCD_VER}-linux-amd64.tar.gz \ + && rm -rf /usr/local/etcd && mkdir -p /usr/local/etcd \ + && curl -L ${DOWNLOAD_ETCD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /usr/local/etcd-${ETCD_VER}-linux-amd64.tar.gz \ + && tar xzvf /usr/local/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /usr/local/etcd --strip-components=1 \ + && rm -f /usr/local/etcd-${ETCD_VER}-linux-amd64.tar.gz \ + && ln -sf /usr/local/etcd/etcd /usr/bin/etcd && ln -sf /usr/local/etcd/etcdctl /usr/bin/etcdctl \ + && wget https://curve-build.nos-eastchina1.126.net/memcache/memcached-1.6.17.tar.gz \ + && tar xvf memcached-1.6.17.tar.gz && cd memcached-1.6.17/ \ + && ./configure && make && make install \ + && cd / && rm -rf memcached-1.6.17/ memcached-1.6.17.tar.gz \ + && wget https://curve-build.nos-eastchina1.126.net/curve-base.tar.gz \ + && tar -xzf curve-base.tar.gz \ + && mv fusermount3 /usr/local/bin \ + && mv libetcdclient.so /usr/lib/ \ + && mv libfuse3.so libfuse3.so.3 libfuse3.so.3.10.5 libnl-3.so.200 libnl-genl-3.so.200 /usr/lib/x86_64-linux-gnu/ \ + && mv libjemalloc.so libjemalloc.so.1 libjemalloc.so.2 /usr/local/lib/ \ + && rm curve-base.tar.gz