diff --git a/docker/builder/Dockerfile-tics b/docker/builder/Dockerfile-tics new file mode 100644 index 00000000000..716edeb44ec --- /dev/null +++ b/docker/builder/Dockerfile-tics @@ -0,0 +1,12 @@ +FROM ubuntu:17.10 + +RUN apt update && \ + apt install -y tzdata + +COPY tics /tics + +WORKDIR /tics + +ENV LD_LIBRARY_PATH /tics + +ENTRYPOINT ["./theflash", "server"] diff --git a/docker/builder/Makefile b/docker/builder/Makefile index 2f40549cd6c..c442d01fc65 100644 --- a/docker/builder/Makefile +++ b/docker/builder/Makefile @@ -1,11 +1,14 @@ build: - docker run --rm --workdir /server -v $(realpath ../..):/server -it hub.pingcap.net/tiflash/tiflash-builder + docker run --rm --workdir /server -v $(realpath ../..):/server hub.pingcap.net/tiflash/tics-builder pull: - docker pull hub.pingcap.net/tiflash/tiflash-builder + docker pull hub.pingcap.net/tiflash/tics-builder image: - docker build -t hub.pingcap.net/tiflash/tiflash-builder + docker build -t hub.pingcap.net/tiflash/tics-builder . image_push: - docker push hub.pingcap.net/tiflash/tiflash-builder + docker push hub.pingcap.net/tiflash/tics-builder + +tics_image: + docker build -f Dockerfile-tics -t hub.pingcap.net/tiflash/tics . diff --git a/docker/builder/build.sh b/docker/builder/build.sh index eb3ab010183..f72bf201a35 100644 --- a/docker/builder/build.sh +++ b/docker/builder/build.sh @@ -7,3 +7,13 @@ cd /server/build_docker CC=/usr/lib/llvm-5.0/bin/clang CXX=/usr/lib/llvm-5.0/bin/clang++ LLVM_ROOT=/usr/lib/llvm-5.0 cmake /server -DENABLE_EMBEDDED_COMPILER=1 -DENABLE_TESTS=0 make -j $(nproc || grep -c ^processor /proc/cpuinfo) theflash #ctest -V -j $(nproc || grep -c ^processor /proc/cpuinfo) + +install_dir="/server/docker/builder/tics" +mkdir -p "$install_dir" +rm -rf $install_dir/* +cp -f "/server/build_docker/dbms/src/Server/theflash" "$install_dir" + +ldd "/server/build_docker/dbms/src/Server/theflash" | grep '/' | grep '=>' | \ + awk -F '=>' '{print $2}' | awk '{print $1}' | while read lib; do + cp -f "$lib" "$install_dir" +done