From ca373b7b498ca3edc4e8fcb67c54c4fc4a4fcf72 Mon Sep 17 00:00:00 2001 From: Michail Buylov Date: Mon, 6 Nov 2023 15:51:42 +0300 Subject: [PATCH 1/2] build in docker --- .dockerignore | 11 +++++++++++ .gitignore | 1 + Dockerfile | 12 +++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5db16c9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.DS_Store +.ci +.cppcheck +.github +.idea +Dockerfile +docs-md +Readme.md +Doxyfile +.travis.yml +customdoxygen.css \ No newline at end of file diff --git a/.gitignore b/.gitignore index cfe4070..96f1fc9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ CMakeCache.txt *build_info.h config.h docs +/.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2a9a13c..bece400 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ FROM debian ENV LANG ru_RU.UTF-8 ENV TZ="Europe/Moscow" - -COPY binaries/btpd /usr/local/bin/ RUN apt update && apt install -y libsnappy1v5 -RUN groupadd -g 80 www \ - && useradd -u 30 --shell /sbin/nologin --group www wwwrun; +RUN apt -y install g++ cmake git wget +RUN groupadd -g 80 www && useradd -u 30 --shell /sbin/nologin --group www wwwrun; +RUN mkdir /bptd +COPY . /btpd/ +RUN cd /btpd && make release USER wwwrun - +EXPOSE 38001 38001/udp 38000 38000/udp 37000 37001 37002 37003 37004 +CMD ["/btpd/build/bin/btpd", "-V", "/btpd/examples/simple/btp.conf"] \ No newline at end of file From 9c7aa8cdc42cb586946dc569305b5b1b7e85ccf1 Mon Sep 17 00:00:00 2001 From: Michail Buylov Date: Wed, 15 Nov 2023 11:54:05 +0300 Subject: [PATCH 2/2] fixes for build in docker --- .dockerignore | 5 ++++- .gitignore | 5 ++++- Dockerfile | 13 +++++++++++-- examples/simple/btp.ini | 2 +- get_ssh_keys | 3 +++ 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 get_ssh_keys diff --git a/.dockerignore b/.dockerignore index 5db16c9..38daa6a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,4 +8,7 @@ docs-md Readme.md Doxyfile .travis.yml -customdoxygen.css \ No newline at end of file +customdoxygen.css +run.sh +get_ssh_keys +.gitignore \ No newline at end of file diff --git a/.gitignore b/.gitignore index 96f1fc9..039cc06 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,7 @@ CMakeCache.txt *build_info.h config.h docs -/.idea \ No newline at end of file +/.idea +id_rsa +id_rsa.pub +/logs \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bece400..8ded055 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,16 @@ RUN apt -y install g++ cmake git wget RUN groupadd -g 80 www && useradd -u 30 --shell /sbin/nologin --group www wwwrun; RUN mkdir /bptd COPY . /btpd/ +RUN mkdir ~/.ssh +RUN chmod 700 ~/.ssh +COPY id_rsa /root/.ssh/ +COPY id_rsa.pub /root/.ssh/ +RUN chmod 600 /root/.ssh/id_rsa +RUN chmod 600 /root/.ssh/id_rsa.pub +RUN ssh-keyscan github.com >> /root/.ssh/known_hosts RUN cd /btpd && make release -USER wwwrun EXPOSE 38001 38001/udp 38000 38000/udp 37000 37001 37002 37003 37004 -CMD ["/btpd/build/bin/btpd", "-V", "/btpd/examples/simple/btp.conf"] \ No newline at end of file +WORKDIR /btpd/ +RUN rm /root/.ssh/id_rsa +RUN rm /root/.ssh/id_rsa.pub +CMD ["build/bin/btpd", "-C", "examples/simple/btp.conf"] diff --git a/examples/simple/btp.ini b/examples/simple/btp.ini index 247f555..9f63de0 100644 --- a/examples/simple/btp.ini +++ b/examples/simple/btp.ini @@ -2,7 +2,7 @@ log = logs/btp.log [db] - path=btp/ + path=btp/storage/ # ======================================= [rt-udp] diff --git a/get_ssh_keys b/get_ssh_keys new file mode 100755 index 0000000..8d99329 --- /dev/null +++ b/get_ssh_keys @@ -0,0 +1,3 @@ +#!/bin/bash +cp ~/.ssh/id_rsa . +cp ~/.ssh/id_rsa.pub . \ No newline at end of file