Skip to content

Commit eda5a13

Browse files
committed
Dockerfile
1 parent 9fab756 commit eda5a13

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

docker/Dockerfile

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,59 @@
1414
# docker image push chronolaw/cpp_study
1515
# docker image pull chronolaw/cpp_study
1616

17-
ARG SRC_IMAGE="chronolaw/http_study"
17+
ARG SRC_IMAGE="gcc:7"
1818

1919
FROM ${SRC_IMAGE}
2020

2121
#LABEL version="2020-09"
22+
23+
# gcc-multilib g++-multilib
24+
# linux-tools-common
2225
# linux-tools-4.4.0-31-generic linux-cloud-tools-4.4.0-31-generic linux-tools-generic linux-cloud-tools-generic
23-
# python3-dev python3-pip
24-
# google-perftools libgoogle-perftools-dev
2526
# graphviz
26-
# && pip3 install pybind11
2727
# && DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
28+
# && mkdir -p cpp_study/common \
29+
30+
ARG CPR_VERSION="1.5.1"
31+
ARG LUAJIT_VERSION="2.1-20200102"
32+
ARG LUABRIDAGE_VERSION="2.6"
2833

2934
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
30-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
31-
gcc-multilib g++-multilib \
32-
cmake pstack strace linux-tools-common \
35+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
36+
vim cmake pstack strace \
3337
libmsgpack-dev protobuf-compiler libprotobuf-dev \
3438
libcurl4-openssl-dev libzmq3-dev \
39+
python3-dev python3-pip \
40+
google-perftools libgoogle-perftools-dev \
41+
&& pip3 install pybind11 \
3542
&& cd \
3643
&& git clone https://github.com/chronolaw/cpp_study \
3744
&& mkdir github \
3845
&& cd github \
3946
&& curl -fsL https://github.com/nlohmann/json/releases/download/v3.9.1/json.hpp -o json.hpp \
40-
&& cp json.hpp ~/cpp_study/common \
41-
&& curl -fsL https://github.com/whoshuu/cpr/archive/1.4.0.tar.gz -o cpr.tgz \
47+
&& ln -s json.hpp ~/cpp_study/common/json.hpp \
48+
&& curl -fsL https://github.com/whoshuu/cpr/archive/${CPR_VERSION}.tar.gz -o cpr.tgz \
4249
&& tar xfz cpr.tgz \
43-
&& cd cpr-1.4.0 \
50+
&& cd cpr-${CPR_VERSION} \
4451
&& cmake . -DUSE_SYSTEM_CURL=ON -DBUILD_CPR_TESTS=OFF \
4552
&& make && make install \
4653
&& cd .. \
47-
&& curl -fsL https://github.com/openresty/luajit2/archive/v2.1-20200102.tar.gz -o luajit.tgz \
54+
&& curl -fsL https://github.com/openresty/luajit2/archive/v${LUAJIT_VERSION}.tar.gz -o luajit.tgz \
4855
&& tar xfz luajit.tgz \
49-
&& cd luajit2-2.1-20200102 \
56+
&& cd luajit2-${LUAJIT_VERSION} \
5057
&& make && make install \
51-
&& curl -fsL https://github.com/vinniefalco/LuaBridge/archive/2.6.tar.gz -o LuaBridge.tgz \
5258
&& cd .. \
53-
&& git clone https://github.com/brendangregg/FlameGraph.git
59+
&& curl -fsL https://github.com/vinniefalco/LuaBridge/archive/${LUABRIDAGE_VERSION}.tar.gz -o LuaBridge.tgz \
60+
&& tar xfz LuaBridge.tgz \
61+
&& cd LuaBridge-${LUABRIDAGE_VERSION} \
62+
&& ln -s Source/LuaBridge/ ~/cpp_study/common/ \
63+
&& cd .. \
64+
&& git clone https://github.com/brendangregg/FlameGraph.git \
65+
&& rm *.tgz \
66+
&& echo "alias ll='ls -l'" >> ~/.bashrc \
67+
&& echo "alias l='ls -lh'" >> ~/.bashrc \
68+
&& echo "alias vi='vim'" >> ~/.bashrc \
69+
&& echo "set -o vi" >> ~/.bashrc
5470

5571

5672
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)