From ed8d569cba00703cdee67d53f078c14afc0fa475 Mon Sep 17 00:00:00 2001 From: Cyber-SiKu Date: Wed, 14 Sep 2022 14:11:33 +0800 Subject: [PATCH] curve/docker: build & make image in docker Signed-off-by: Cyber-SiKu --- curvefs/docker/debian10/base/Dockerfile | 9 ++++++--- curvefs/docker/debian10/compile/Dockerfile | 20 ++++++++++++++++++-- curvefs/docker/debian11/base/Dockerfile | 7 +++++-- curvefs/docker/debian11/compile/Dockerfile | 19 +++++++++++++++++-- curvefs/docker/debian9/base/Dockerfile | 6 +++--- curvefs/docker/debian9/compile/Dockerfile | 22 +++++++++++++++++++--- 6 files changed, 68 insertions(+), 15 deletions(-) diff --git a/curvefs/docker/debian10/base/Dockerfile b/curvefs/docker/debian10/base/Dockerfile index a54319e6a3..51aa36d848 100644 --- a/curvefs/docker/debian10/base/Dockerfile +++ b/curvefs/docker/debian10/base/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:10 +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" \ @@ -31,6 +31,9 @@ RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib\n" \ libnl-3-200 \ libnl-genl-3-200 \ libjemalloc2 \ - && ln -s /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so + 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/ \ No newline at end of file +COPY libetcdclient.so /usr/lib/ diff --git a/curvefs/docker/debian10/compile/Dockerfile b/curvefs/docker/debian10/compile/Dockerfile index 7d9c36d9a8..e9c759ffc3 100644 --- a/curvefs/docker/debian10/compile/Dockerfile +++ b/curvefs/docker/debian10/compile/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:10 +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" \ @@ -27,9 +27,25 @@ RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib\n" \ 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 -s /usr/bin/bazelisk /usr/bin/bazel \ + && 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 \ diff --git a/curvefs/docker/debian11/base/Dockerfile b/curvefs/docker/debian11/base/Dockerfile index 6aeafd8052..19c74f896e 100644 --- a/curvefs/docker/debian11/base/Dockerfile +++ b/curvefs/docker/debian11/base/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:11 +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" \ @@ -31,6 +31,9 @@ RUN echo "deb http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ libnl-3-200 \ libnl-genl-3-200 \ libjemalloc2 \ - && ln -s /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so + 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/compile/Dockerfile b/curvefs/docker/debian11/compile/Dockerfile index d94d163a08..0ebfee2c03 100644 --- a/curvefs/docker/debian11/compile/Dockerfile +++ b/curvefs/docker/debian11/compile/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:11 +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" \ @@ -27,9 +27,24 @@ RUN echo "deb http://mirrors.163.com/debian/ bullseye main non-free contrib\n" \ 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 -s /usr/bin/bazelisk /usr/bin/bazel \ + && 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 \ diff --git a/curvefs/docker/debian9/base/Dockerfile b/curvefs/docker/debian9/base/Dockerfile index 78ee19ea9d..39c37079d7 100644 --- a/curvefs/docker/debian9/base/Dockerfile +++ b/curvefs/docker/debian9/base/Dockerfile @@ -24,9 +24,9 @@ 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 \ diff --git a/curvefs/docker/debian9/compile/Dockerfile b/curvefs/docker/debian9/compile/Dockerfile index 436353f1ae..07b7cf63c8 100644 --- a/curvefs/docker/debian9/compile/Dockerfile +++ b/curvefs/docker/debian9/compile/Dockerfile @@ -1,4 +1,4 @@ -FROM opencurvedocker/curve-base:debian9 +FROM opencurvedocker/curve-base:build-debian9 RUN apt-get clean \ && apt-get -y update \ @@ -10,7 +10,6 @@ RUN apt-get clean \ libnl-genl-3-dev \ libssl-dev \ uuid-dev \ - zlib1g-dev \ libcurl4-gnutls-dev \ libfiu-dev \ openjdk-8-jdk \ @@ -21,9 +20,26 @@ RUN apt-get clean \ 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 -s /usr/bin/bazelisk /usr/bin/bazel \ + && 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 \