Skip to content

Commit

Permalink
Build tics docker image (#6)
Browse files Browse the repository at this point in the history
* Build tics docker image

* Remove it option for docker build
  • Loading branch information
zanmato1984 authored Mar 5, 2019
1 parent d9c4906 commit 6250291
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
12 changes: 12 additions & 0 deletions docker/builder/Dockerfile-tics
Original file line number Diff line number Diff line change
@@ -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"]
11 changes: 7 additions & 4 deletions docker/builder/Makefile
Original file line number Diff line number Diff line change
@@ -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 .
10 changes: 10 additions & 0 deletions docker/builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6250291

Please sign in to comment.