From 6b478b546066b2e344aec30e2e1b1d2ffda1ca36 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:10:02 -0500 Subject: [PATCH 01/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 40 +++++++++++++++++++++------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0b8ab780..81067c9b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -20,17 +20,39 @@ env: jobs: # Run tests. # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - test: + mysql57: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Shutdown existing MySQL + run: sudo service mysql stop + - name: Set up MySQL + uses: cweinberger/github-actions-mysql@master + with: + version: 5.7 + hostPort: 33069 + containerPort: 3306 + rootPassword: root + user: TestUser + password: TestPassword + database: TestDatabase + characterSet: utf8mb4 + collation: utf8mb4_general_ci + sqlMode: NO_ENGINE_SUBSTITUTION + - name: Print running docker containers + run: docker ps + +test: runs-on: ubuntu-20.04 - services: - mysql: - image: mysql:8.0.23 - env: - MYSQL_USER: test - MYSQL_ROOT_PASSWORD: test - ports: - - 3306 + # services: + # mysql: + # image: mysql:8.0.23 + # env: + # MYSQL_USER: test + # MYSQL_ROOT_PASSWORD: test + # ports: + # - 3306 steps: - uses: actions/checkout@v2 From afec333f80da0938cb995d20aac51fca9d2c32e1 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:11:54 -0500 Subject: [PATCH 02/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 81067c9b..291034d2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -42,8 +42,8 @@ jobs: - name: Print running docker containers run: docker ps -test: - runs-on: ubuntu-20.04 +#test: +# runs-on: ubuntu-20.04 # services: # mysql: From 26f75971e7e33bcba23c68130ab48cf676ba41f5 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:13:24 -0500 Subject: [PATCH 03/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 291034d2..236b1d7a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -54,28 +54,28 @@ jobs: # ports: # - 3306 - steps: - - uses: actions/checkout@v2 + #steps: + # - uses: actions/checkout@v2 - - name: Get the mysql host - id: get_host - run: | + - name: Get the mysql host + id: get_host + run: | #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' - - name: Copy envs - run: | + - name: Copy envs + run: | cp -a .env-org server/.env sed -i 's/127.0.0.1/${{ steps.get_host.outputs.db-host }}/g' server/.env cat server/.env - - name: Run tests - run: | + - name: Run tests + run: | if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut @@ -87,7 +87,7 @@ jobs: # See also https://docs.docker.com/docker-hub/builds/ push: # Ensure test job passes before pushing image. - needs: test + # needs: test runs-on: ubuntu-latest if: github.event_name == 'push' From e9ea4045677fc98650bc0005a8076e3fb47f31bf Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:14:45 -0500 Subject: [PATCH 04/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 236b1d7a..68d10707 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -27,7 +27,7 @@ jobs: - name: Shutdown existing MySQL run: sudo service mysql stop - name: Set up MySQL - uses: cweinberger/github-actions-mysql@master + uses: cweinberger/github-actions-mysql with: version: 5.7 hostPort: 33069 From ca2368e0c42a9c433db688b3356acd25df7579bf Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:15:37 -0500 Subject: [PATCH 05/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 68d10707..c7859173 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -27,7 +27,7 @@ jobs: - name: Shutdown existing MySQL run: sudo service mysql stop - name: Set up MySQL - uses: cweinberger/github-actions-mysql + uses: cweinberger/github-actions-mysql@main with: version: 5.7 hostPort: 33069 From a096b061cc577dd01be137465d037d595ba11963 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:17:49 -0500 Subject: [PATCH 06/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c7859173..9a2199c5 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -64,7 +64,7 @@ jobs: #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client - mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' + mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} -e 'show databases;' - name: Copy envs run: | From d3645df99efe8eb60ee49de955c91c81736cce60 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:19:24 -0500 Subject: [PATCH 07/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9a2199c5..4c6cdade 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -64,8 +64,7 @@ jobs: #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client - mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} -e 'show databases;' - + mysql -uroot --password=test -h127.0.0.1 -e 'show databases;' - name: Copy envs run: | cp -a .env-org server/.env From 0eed772f48ae97c0641c112d6d177ae0513776e3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:25:11 -0500 Subject: [PATCH 08/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4c6cdade..0f5468b1 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -64,7 +64,7 @@ jobs: #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client - mysql -uroot --password=test -h127.0.0.1 -e 'show databases;' + mysql -uroot --password=test -h 127.0.0.1 -e 'show databases;' - name: Copy envs run: | cp -a .env-org server/.env From 8a73d4190462401c48c5312d0ef98e60b1af3480 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:26:36 -0500 Subject: [PATCH 09/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0f5468b1..44ef05f8 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -64,7 +64,7 @@ jobs: #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client - mysql -uroot --password=test -h 127.0.0.1 -e 'show databases;' + mysql -uroot --password=test -h 127.0.0.1 -p 33060 -e 'show databases;' - name: Copy envs run: | cp -a .env-org server/.env From a58d79b8afedb0cd95224b36c215887360549dec Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:28:37 -0500 Subject: [PATCH 10/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 44ef05f8..cac01874 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -30,7 +30,7 @@ jobs: uses: cweinberger/github-actions-mysql@main with: version: 5.7 - hostPort: 33069 + hostPort: 3306 containerPort: 3306 rootPassword: root user: TestUser From 13231d65ce25cdd63a7e2d382a832f75180fcb59 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:30:18 -0500 Subject: [PATCH 11/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index cac01874..68bb1dfe 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,8 +63,9 @@ jobs: #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" + sleep 15 sudo apt -y install mysql-client - mysql -uroot --password=test -h 127.0.0.1 -p 33060 -e 'show databases;' + mysql -uroot --password=test -h 127.0.0.1 -e 'show databases;' - name: Copy envs run: | cp -a .env-org server/.env From 60e3abe62127c7d8dc653ea72050329a258de2a4 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:31:50 -0500 Subject: [PATCH 12/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 68bb1dfe..a7d94691 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,9 +63,9 @@ jobs: #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" - sleep 15 + sleep 5 sudo apt -y install mysql-client - mysql -uroot --password=test -h 127.0.0.1 -e 'show databases;' + mysql -uroot --password=root -h 127.0.0.1 -e 'show databases;' - name: Copy envs run: | cp -a .env-org server/.env From eef45313395a7866af97e7aa65863f557de68a41 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:34:46 -0500 Subject: [PATCH 13/72] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index fb66885f..a9f9151b 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -41,7 +41,7 @@ CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client #RUN ip a -RUN mysql -uroot -proot -h$BLUECHERRY_DB_HOST -e 'SELECT version()' +RUN mysql -uroot -proot -h 127.0.0.1 -e 'SELECT version()' # --------------------------------------------------------------------------- From f9bc08b02a0dc306daffbd9d8c6daaae4ff2eb8c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:36:23 -0500 Subject: [PATCH 14/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a7d94691..e6004971 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,7 +63,7 @@ jobs: #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" - sleep 5 + sleep 10 sudo apt -y install mysql-client mysql -uroot --password=root -h 127.0.0.1 -e 'show databases;' - name: Copy envs From 6722a8bb6b023fef6abc1e3b67f94999b628adae Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:46:07 -0500 Subject: [PATCH 15/72] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index a9f9151b..4f34bc68 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -41,7 +41,7 @@ CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client #RUN ip a -RUN mysql -uroot -proot -h 127.0.0.1 -e 'SELECT version()' +RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' # --------------------------------------------------------------------------- From d56066d814b99de7a809679e5eb91b04cf990ed2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 28 Jul 2023 21:50:03 -0500 Subject: [PATCH 16/72] Update Dockerfile --- server/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 4f34bc68..46d59b2d 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -138,7 +138,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=127.0.0.1 +ARG BLUECHERRY_DB_HOST=172.17.0.1 ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% @@ -360,11 +360,11 @@ COPY --from=bluecherry_build_cleaned \ COPY bluecherry.conf /etc/bluecherry.conf ARG MYSQL_ADMIN_LOGIN=root -ARG MYSQL_ADMIN_PASSWORD +ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=mysql +ARG BLUECHERRY_DB_HOST=bc-mysql ARG BLUECHERRY_DB_PASSWORD=bluecherry ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From 1358d8c90d41c849f8751b3dd2b05a87876f28ae Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 31 Jul 2023 18:04:06 -0500 Subject: [PATCH 17/72] Update Dockerfile --- server/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 46d59b2d..5b7a829a 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -22,7 +22,7 @@ CMD ["echo", "Testing mysql connection via nmap..."] RUN apt-get update RUN apt-get -y install nmap -RUN nmap $BLUECHERRY_DB_HOST -p 3306 +#RUN nmap mysql -p 3306 CMD ["echo", "Installing other stuff..."] @@ -116,7 +116,7 @@ RUN apt update # php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2 RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 curl \ libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \ - php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver + php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver mysql-client @@ -141,7 +141,7 @@ ARG BLUECHERRY_DB_USER=bluecherry ARG BLUECHERRY_DB_HOST=172.17.0.1 ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry -ARG BLUECHERRY_DB_ACCESS_HOST=% +ARG BLUECHERRY_DB_ACCESS_HOST='%' # User and Group info used for running bluecherry server processes ARG BLUECHERRY_LINUX_GROUP_NAME=bluecherry @@ -232,7 +232,7 @@ RUN /usr/sbin/groupadd -rf \ --comment "Bluecherry DVR" \ --home-dir=/var/lib/bluecherry \ --gid=$BLUECHERRY_LINUX_GROUP_NAME \ - --groups=audio,video \ + --groups=audio,video,render \ --uid=$BLUECHERRY_LINUX_USER_ID \ $BLUECHERRY_LINUX_USER_NAME \ || echo "bluecherry user already exists" From 20e6e5ad5689c3b4b3f6a53ac5a16cf1b917a129 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 31 Jul 2023 18:09:05 -0500 Subject: [PATCH 18/72] Update Dockerfile Install python3 --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 5b7a829a..b06e2e1e 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -116,7 +116,7 @@ RUN apt update # php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2 RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 curl \ libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \ - php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver mysql-client + php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver mysql-client python3 From b7bbb5a691bcbe238230bb1439f161eab375ae81 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 31 Jul 2023 18:14:40 -0500 Subject: [PATCH 19/72] Update Dockerfile Install python3-pip --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index b06e2e1e..06398199 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -116,7 +116,7 @@ RUN apt update # php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2 RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 curl \ libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \ - php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver mysql-client python3 + php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver mysql-client python3-pip From 7f9b85fab188264a91462b8bc3e1b8fa9f5683a0 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 31 Jul 2023 19:16:12 -0500 Subject: [PATCH 20/72] Update Dockerfile --- server/Dockerfile | 155 ++++------------------------------------------ 1 file changed, 13 insertions(+), 142 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 06398199..e8abc246 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -243,7 +243,7 @@ RUN mkdir /recordings \ EXPOSE 7001/tcp 7002/tcp # This is the main script that runs as process ID 1 in the docker container -COPY entrypoint.sh /entrypoint.sh +#COPY server/entrypoint.sh /entrypoint.sh # These scripts are wrappers used to manage the bluecherry database. They are # necessary because the bluecherry installer usually sets up the database, but @@ -253,82 +253,26 @@ COPY entrypoint.sh /entrypoint.sh # # --- CREATE: sudo docker-compose run bluecherry bc-database-create # --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade -COPY bc-database-create.sh /bin/bc-database-create -COPY bc-database-upgrade.sh /bin/bc-database-upgrade +#COPY server/bc-database-create.sh /bin/bc-database-create +#COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade # This copies in a modified rsyslog config, which tells rsyslog to route # bluecherry logs to both /var/log/bluecherry.log (within the container) and # also to the STDOUT of container process with PID 1, which then allows the # logs to be received by the docker engine (and read via `docker logs` , etc.) -COPY bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf +#COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf # Make the previously copied scripts executable -RUN chmod +x /entrypoint.sh \ - && chmod +x /bin/bc-database-create \ - && chmod +x /bin/bc-database-upgrade +#RUN chmod +x /entrypoint.sh \ +# && chmod +x /bin/bc-database-create \ +# && chmod +x /bin/bc-database-upgrade -CMD "/entrypoint.sh" +#CMD "/entrypoint.sh" #ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 - -# --------------------------------------------------------------------------- -# Build the base OS with some development libs and tools -FROM baseos AS os_dev_environment -ENV DEBIAN_FRONTEND=noninteractive -WORKDIR /root - -RUN apt-get update - -RUN apt-get install --no-install-recommends -y \ - git sudo openssl ca-certificates wget gnupg gnupg2 gnupg1 \ - ssl-cert nmap curl sysstat iproute2 \ - autoconf automake libtool build-essential gcc g++ \ - debhelper ccache bison flex texinfo yasm cmake - -RUN apt-get install --no-install-recommends -y \ - libbsd-dev libopencv-dev libudev-dev libva-dev \ - linux-image-generic linux-headers-generic \ - libmysqlclient-dev rsyslog - - -# --------------------------------------------------------------------------- -FROM os_dev_environment as bluecherry_base_environment -ENV DEBIAN_FRONTEND=noninteractive -WORKDIR /root - -RUN git clone --progress --depth 1 \ - http://github.com/bluecherrydvr/bluecherry-apps.git \ - && cd bluecherry-apps \ - && git checkout $BLUECHERRY_GIT_BRANCH_TAG - -RUN apt-get --no-install-recommends -y install \ - libbsd0 libc6 libgcc1 libssl1.1 libstdc++6 libudev1 \ - zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver - -RUN apt-get --no-install-recommends -y install \ - php-mail php-mail-mime php-net-smtp php-gd php-curl \ - php-mysql php-sqlite3 \ -# apache2 libapache2-mod-php mysql-client sqlite3 - nginx default-mysql-client sqlite3 - -# --------------------------------------------------------------------------- -# Build the bluecherry app and dependencies. This is done in a separate -# image because there are many ways it can fail and then we save time -# by being able to reuse prior containers leading up to this build. -FROM bluecherry_base_environment as bluecherry_build -ENV DEBIAN_FRONTEND=noninteractive -WORKDIR /root - -COPY depends/onvif_tool bluecherry-apps/utils/onvif_tool - -RUN cd bluecherry-apps \ - && ./scripts/build_pkg_native.sh - - -# --------------------------------------------------------------------------- -FROM bluecherry_build as bluecherry_build_cleaned +FROM os_dev_environment as bluecherry_build_cleaned ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root @@ -341,79 +285,6 @@ RUN rm -rf .ccache \ && rm -rf bluecherry-apps/misc/pugixml -# --------------------------------------------------------------------------- -# Install the bluecherry app and dependencies -FROM baseos as bluecherry_install -ENV DEBIAN_FRONTEND=noninteractive -WORKDIR /root - -COPY --from=bluecherry_build_cleaned \ - /root/bluecherry-apps/releases/bluecherry_*.deb \ - /root/bluecherry-apps/releases/ - -# This step is needed if/when building a new bluecherry docker container -# that will connect to an existing bluecherry database. In this case, the -# bluecherry installer will see the existing database, and it needs the -# /etc/bluecherry.conf file to tell it that it is okay to connect to (and -# modify) that database -# -COPY bluecherry.conf /etc/bluecherry.conf - -ARG MYSQL_ADMIN_LOGIN=root -ARG MYSQL_ADMIN_PASSWORD=root - -# Specific database credentials used by bluecherry server -ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=bc-mysql -ARG BLUECHERRY_DB_PASSWORD=bluecherry -ARG BLUECHERRY_DB_NAME=bluecherry -ARG BLUECHERRY_DB_ACCESS_HOST=% - -# User and Group info used for running bluecherry server processes -ARG BLUECHERRY_LINUX_GROUP_NAME=bluecherry -ARG BLUECHERRY_LINUX_GROUP_ID=1000 -ARG BLUECHERRY_LINUX_USER_NAME=bluecherry -ARG BLUECHERRY_LINUX_USER_ID=1000 - -RUN apt-get update \ - && apt-get install -y \ - rsyslog nmap curl sysstat iproute2 \ - openssl ca-certificates ssl-cert gnupg gnupg2 gnupg1 - -RUN { \ - echo "[client]"; \ - echo "user=$MYSQL_ADMIN_LOGIN"; \ - echo "password=$MYSQL_ADMIN_PASSWORD"; \ - echo "[mysql]"; \ - echo "user=$MYSQL_ADMIN_LOGIN"; \ - echo "password=$MYSQL_ADMIN_PASSWORD"; \ - echo "[mysqldump]"; \ - echo "user=$MYSQL_ADMIN_LOGIN"; \ - echo "password=$MYSQL_ADMIN_PASSWORD"; \ - echo "[mysqldiff]"; \ - echo "user=$MYSQL_ADMIN_LOGIN"; \ - echo "password=$MYSQL_ADMIN_PASSWORD"; \ - } > /root/.my.cnf - -# NOTE: The line "export host=$BLUECHERRY_DB_HOST" ... This is required -# due to a weird global check of this env var by the "check_mysql_admin" -# function in /usr/share/bluecherry/bc_db_tool.sh ... which doesn't accept -# the db host as an argument like most of the other functions in that file. -# --- The Specific problem line is: -# if ! echo "show databases" | mysql_wrapper -h"${host}" -u"$MYSQL_ADMIN_LOGIN" &>/dev/null -# -RUN { \ - echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ - echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ - echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \ - echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \ - echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \ - echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \ - echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \ - } | debconf-set-selections \ - && export host=$BLUECHERRY_DB_HOST \ - && apt install -y ./bluecherry-apps/releases/bluecherry_*.deb - # Cleanup tasks RUN apt-get clean \ && rm -f bluecherry-apps/releases/bluecherry_*.deb \ @@ -448,7 +319,7 @@ RUN mkdir /recordings \ EXPOSE 7001/tcp 7002/tcp 554/tcp 554/udp # This is the main script that runs as process ID 1 in the docker container -COPY entrypoint.sh /entrypoint.sh +COPY server/entrypoint.sh /entrypoint.sh # These scripts are wrappers used to manage the bluecherry database. They are # necessary because the bluecherry installer usually sets up the database, but @@ -458,14 +329,14 @@ COPY entrypoint.sh /entrypoint.sh # # --- CREATE: sudo docker-compose run bluecherry bc-database-create # --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade -COPY bc-database-create.sh /bin/bc-database-create -COPY bc-database-upgrade.sh /bin/bc-database-upgrade +COPY server/bc-database-create.sh /bin/bc-database-create +COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade # This copies in a modified rsyslog config, which tells rsyslog to route # bluecherry logs to both /var/log/bluecherry.log (within the container) and # also to the STDOUT of container process with PID 1, which then allows the # logs to be received by the docker engine (and read via `docker logs` , etc.) -COPY bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf +COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf # Make the previously copied scripts executable RUN chmod +x /entrypoint.sh \ From 54a6c13c9ae5125ee56917b8ab8073bd1c66fe35 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 31 Jul 2023 19:29:57 -0500 Subject: [PATCH 21/72] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index e8abc246..dc132b9a 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -223,7 +223,7 @@ RUN rm -f /etc/bluecherry.conf # When running rsyslog in a container, we need to disable imklog # since the in-container process won't be allowed access to it. -RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf +#RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf RUN /usr/sbin/groupadd -rf \ --gid=$BLUECHERRY_LINUX_GROUP_ID \ From 51b9de878bb09ca11f8dcff576f9e73f88744e45 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 31 Jul 2023 19:35:24 -0500 Subject: [PATCH 22/72] Update Dockerfile Remove more duplicates --- server/Dockerfile | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index dc132b9a..435b0f98 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -278,28 +278,17 @@ WORKDIR /root RUN rm -rf /usr/src/linux-headers-* -RUN rm -rf .ccache \ - && rm -rf bluecherry-apps/.git \ - && rm -rf bluecherry-apps/misc/libav \ - && rm -rf bluecherry-apps/misc/libconfig \ - && rm -rf bluecherry-apps/misc/pugixml - - -# Cleanup tasks -RUN apt-get clean \ - && rm -f bluecherry-apps/releases/bluecherry_*.deb \ - && rm -rf /var/lib/apt/lists/* # Remove these files -- we needed them to build the docker image, since the # bluecherry installer scripts interact with the database. However, once the # image is created, we expect it to receive all of the settings/credentials # from environment variables passed in by docker or docker-compose. -RUN rm -f /root/.my.cnf \ - && rm -f /etc/bluecherry.conf +#RUN rm -f /root/.my.cnf \ +# && rm -f /etc/bluecherry.conf # When running rsyslog in a container, we need to disable imklog # since the in-container process won't be allowed access to it. -RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf +#RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf RUN /usr/sbin/groupadd -rf \ --gid=$BLUECHERRY_LINUX_GROUP_ID \ From 38ade2e1bed155896c250859577f5b5d1401fa68 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 31 Jul 2023 20:09:03 -0500 Subject: [PATCH 23/72] Update Dockerfile Remove more duplicates --- server/Dockerfile | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 435b0f98..3a283779 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -279,34 +279,6 @@ WORKDIR /root RUN rm -rf /usr/src/linux-headers-* -# Remove these files -- we needed them to build the docker image, since the -# bluecherry installer scripts interact with the database. However, once the -# image is created, we expect it to receive all of the settings/credentials -# from environment variables passed in by docker or docker-compose. -#RUN rm -f /root/.my.cnf \ -# && rm -f /etc/bluecherry.conf - -# When running rsyslog in a container, we need to disable imklog -# since the in-container process won't be allowed access to it. -#RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf - -RUN /usr/sbin/groupadd -rf \ - --gid=$BLUECHERRY_LINUX_GROUP_ID \ - $BLUECHERRY_LINUX_GROUP_NAME \ - && /usr/sbin/useradd -rm \ - --comment "Bluecherry DVR" \ - --home-dir=/var/lib/bluecherry \ - --gid=$BLUECHERRY_LINUX_GROUP_NAME \ - --groups=audio,video \ - --uid=$BLUECHERRY_LINUX_USER_ID \ - $BLUECHERRY_LINUX_USER_NAME \ - || echo "bluecherry user already exists" - -RUN mkdir /recordings \ - && chown bluecherry:bluecherry /recordings - -EXPOSE 7001/tcp 7002/tcp 554/tcp 554/udp - # This is the main script that runs as process ID 1 in the docker container COPY server/entrypoint.sh /entrypoint.sh From a412f52fe1b6e7ee9ed2d6feb66b08fc6fb11dc9 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 11:47:08 -0500 Subject: [PATCH 24/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 151 ++++++++------------------- 1 file changed, 46 insertions(+), 105 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e6004971..c264d80f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,6 +1,8 @@ -name: Docker +name: Publish Docker image on: +# release: +# types: [published] push: # Publish `master` as Docker `latest` image. branches: @@ -9,117 +11,56 @@ on: # Publish `v1.2.3` tags as releases. tags: - v* + pull_request: - # Run tests for any PRs. - pull_request: -env: - # TODO: Change variable to your image's name. - IMAGE_NAME: image - -jobs: - # Run tests. + # steps: +# - uses: actions/checkout@v2 + # Setup mysqlserver. # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - mysql57: +jobs: + push_to_registries: + name: Push Docker image to multiple registries runs-on: ubuntu-latest + permissions: + packages: write + contents: read steps: - - uses: actions/checkout@v2 - - name: Shutdown existing MySQL - run: sudo service mysql stop - - name: Set up MySQL - uses: cweinberger/github-actions-mysql@main - with: - version: 5.7 - hostPort: 3306 - containerPort: 3306 - rootPassword: root - user: TestUser - password: TestPassword - database: TestDatabase - characterSet: utf8mb4 - collation: utf8mb4_general_ci - sqlMode: NO_ENGINE_SUBSTITUTION - - name: Print running docker containers - run: docker ps - -#test: -# runs-on: ubuntu-20.04 - - # services: - # mysql: - # image: mysql:8.0.23 - # env: - # MYSQL_USER: test - # MYSQL_ROOT_PASSWORD: test - # ports: - # - 3306 + - name: Check out the repo + uses: actions/checkout@v3 - #steps: - # - uses: actions/checkout@v2 - - - name: Get the mysql host - id: get_host - run: | + - name: Get the mysql host +# runs-on: ubuntu-latest + id: get_host + run: | #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" - sleep 10 sudo apt -y install mysql-client - mysql -uroot --password=root -h 127.0.0.1 -e 'show databases;' - - name: Copy envs - run: | - cp -a .env-org server/.env - sed -i 's/127.0.0.1/${{ steps.get_host.outputs.db-host }}/g' server/.env - cat server/.env - - - - - name: Run tests - run: | - if [ -f docker-compose.test.yml ]; then - docker-compose --file docker-compose.test.yml build - docker-compose --file docker-compose.test.yml run sut - else - docker build . --file server/Dockerfile --build-arg="$db-host" - fi - - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - push: - # Ensure test job passes before pushing image. - # needs: test - - runs-on: ubuntu-latest - if: github.event_name == 'push' - - steps: - - uses: actions/checkout@v2 - - - name: Build image - run: docker build . --file server/Dockerfile --tag $IMAGE_NAME - - - name: Log into GitHub Container Registry - # TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT` - run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image to GitHub Container Registry - run: | - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - - # Use Docker `latest` tag convention - [ "$VERSION" == "master" ] && VERSION=latest - - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION + mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' +# - name: Push to Docker Hub +# runs-on: ubuntu-latest + + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: bluecherrydvr/bluecherry-server + + - name: Build and push Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + file: ./server/Dockerfile + push: true + tags: testing + labels: testinglabel + + From f67f6ff017b7d855ed910115f4a014ccf72d2012 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 11:48:16 -0500 Subject: [PATCH 25/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c264d80f..6c3c34fd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -37,7 +37,7 @@ jobs: #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client - mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' +# mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' # - name: Push to Docker Hub # runs-on: ubuntu-latest From f73727e4ca93583d2f199ca1286b975b2e6f9998 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 12:12:07 -0500 Subject: [PATCH 26/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6c3c34fd..866d5dbb 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -45,7 +45,7 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a with: - username: ${{ secrets.DOCKER_USERNAME }} + username: curtishall password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract metadata (tags, labels) for Docker From b2e3b005905181dbedde5796051c1af742c2ffd2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 12:16:49 -0500 Subject: [PATCH 27/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 866d5dbb..adc2f6a2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,9 +1,8 @@ name: Publish Docker image on: -# release: -# types: [published] push: + # TODO: Add push type for release # Publish `master` as Docker `latest` image. branches: - master @@ -11,8 +10,9 @@ on: # Publish `v1.2.3` tags as releases. tags: - v* - pull_request: + # Run tests for any PRs. + pull_request: # steps: # - uses: actions/checkout@v2 From 123e424497895f35de13211a381b0ade1a191120 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 12:23:24 -0500 Subject: [PATCH 28/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index adc2f6a2..f618ffbd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -46,8 +46,9 @@ jobs: uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a with: username: curtishall - password: ${{ secrets.DOCKER_PASSWORD }} - +# password: ${{ secrets.DOCKER_PASSWORD }} + password: g5sjax9Tkb2rJp + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 From bf63a2be42ea35602ab336eda4b050b66892bb43 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 12:25:49 -0500 Subject: [PATCH 29/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f618ffbd..c8d8c6d4 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -46,8 +46,7 @@ jobs: uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a with: username: curtishall -# password: ${{ secrets.DOCKER_PASSWORD }} - password: g5sjax9Tkb2rJp + password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract metadata (tags, labels) for Docker id: meta From 46b198f950942a7b32a55478d0dc6b76f14f506a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 12:29:30 -0500 Subject: [PATCH 30/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c8d8c6d4..722db4fd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -37,6 +37,8 @@ jobs: #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client + sudo service mysql-server start +# sleep 10 # mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' # - name: Push to Docker Hub # runs-on: ubuntu-latest From 4c73dbf0611e871586463142fce75dc7aa5371a2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 12:31:17 -0500 Subject: [PATCH 31/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 722db4fd..47dccd12 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -37,7 +37,7 @@ jobs: #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" sudo apt -y install mysql-client - sudo service mysql-server start + sudo systemctl start mysql.service # sleep 10 # mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' # - name: Push to Docker Hub From fc08a362e659506793062bd31326a24379c29b64 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:09:25 -0500 Subject: [PATCH 32/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 85 +++++++++++++++++----------- 1 file changed, 53 insertions(+), 32 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 47dccd12..61674056 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -19,50 +19,71 @@ on: # Setup mysqlserver. # See also https://docs.docker.com/docker-hub/builds/automated-testing/ jobs: - push_to_registries: - name: Push Docker image to multiple registries + mysql57: runs-on: ubuntu-latest - permissions: - packages: write - contents: read steps: - - name: Check out the repo - uses: actions/checkout@v3 + - uses: actions/checkout@v2 + - name: Shutdown existing MySQL + run: sudo service mysql stop + - name: Set up MySQL + uses: cweinberger/github-actions-mysql@main + with: + version: 5.7 + hostPort: 3306 + containerPort: 3306 + rootPassword: root + user: TestUser + password: TestPassword + database: TestDatabase + characterSet: utf8mb4 + collation: utf8mb4_general_ci + sqlMode: NO_ENGINE_SUBSTITUTION + - name: Print running docker containers + run: docker ps + + push_to_registries: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v3 - - name: Get the mysql host + - name: Get the mysql host # runs-on: ubuntu-latest - id: get_host - run: | + id: get_host + run: | #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" - sudo apt -y install mysql-client - sudo systemctl start mysql.service + #sudo apt -y install mysql-client + #sudo systemctl start mysql.service # sleep 10 # mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' # - name: Push to Docker Hub # runs-on: ubuntu-latest - - - - name: Log in to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a - with: - username: curtishall - password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: curtishall + password: ${{ secrets.DOCKER_PASSWORD }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: bluecherrydvr/bluecherry-server + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: bluecherrydvr/bluecherry-server - - name: Build and push Docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: - context: . - file: ./server/Dockerfile - push: true - tags: testing - labels: testinglabel + - name: Build and push Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + file: ./server/Dockerfile + push: true + tags: testing + labels: testinglabel From 6403e6165fad5053caea1cb0238e87585d9a51ba Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:11:54 -0500 Subject: [PATCH 33/72] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 3a283779..92caf67f 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -40,7 +40,7 @@ CMD ["echo", "Installing other stuff..."] CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -#RUN ip a +RUN ip a RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' From 228da46247e902427abaa1d6811c0981993d412a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:13:30 -0500 Subject: [PATCH 34/72] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 92caf67f..3a283779 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -40,7 +40,7 @@ CMD ["echo", "Installing other stuff..."] CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN ip a +#RUN ip a RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' From 036c51c6175c3fbbf0cd823895c93808b8b08063 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:42:46 -0500 Subject: [PATCH 35/72] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 3a283779..7c337533 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -42,7 +42,7 @@ CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client #RUN ip a RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' - + # --------------------------------------------------------------------------- FROM os_dev_environment as bluecherry_base_environment From dd68a5c6fa14cbe064be008930e7560c2aee2d57 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:49:43 -0500 Subject: [PATCH 36/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 40 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 61674056..5827cf1f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -41,20 +41,20 @@ jobs: - name: Print running docker containers run: docker ps - push_to_registries: - name: Push Docker image to multiple registries - runs-on: ubuntu-latest - permissions: +# push_to_registries: + - name: Push Docker image to multiple registries + #runs-on: ubuntu-latest + permissions: packages: write contents: read - steps: - - name: Check out the repo - uses: actions/checkout@v3 + #steps: + - name: Check out the repo + uses: actions/checkout@v3 - - name: Get the mysql host + - name: Get the mysql host # runs-on: ubuntu-latest - id: get_host - run: | + id: get_host + run: | #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` #echo "db-host=$host" >> $GITHUB_OUTPUT #echo "$db-host" @@ -65,21 +65,21 @@ jobs: # - name: Push to Docker Hub # runs-on: ubuntu-latest - - name: Log in to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a - with: + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: username: curtishall password: ${{ secrets.DOCKER_PASSWORD }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: images: bluecherrydvr/bluecherry-server - - name: Build and push Docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: + - name: Build and push Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: context: . file: ./server/Dockerfile push: true From 1f011a4f1653f6596f8f703bc8fdb1d605c01e81 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:50:12 -0500 Subject: [PATCH 37/72] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 7c337533..cf5114eb 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:20.04 AS baseos #ARG DB_HOST=$BLUECHERRY_DB_HOST #RUN echo $BLUECHERRY_DB_HOST -ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 +ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-latest #ARG MYSQLHOST #ENV MYSQL_HOST=MYSQLHOST From 8d888abacf69fe65929e31972a84d90268397c91 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:53:52 -0500 Subject: [PATCH 38/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5827cf1f..1ba1d24c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -42,11 +42,11 @@ jobs: run: docker ps # push_to_registries: - - name: Push Docker image to multiple registries - #runs-on: ubuntu-latest - permissions: - packages: write - contents: read +# - name: Push Docker image to multiple registries +# runs-on: ubuntu-latest +# permissions: +# packages: write +# contents: read #steps: - name: Check out the repo uses: actions/checkout@v3 From 95ae1a43ed6be1927327b56429c536b858bc82d1 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 13:57:50 -0500 Subject: [PATCH 39/72] Update Dockerfile --- server/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index cf5114eb..d4e80bb3 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -45,7 +45,7 @@ RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' # --------------------------------------------------------------------------- -FROM os_dev_environment as bluecherry_base_environment +#FROM os_dev_environment as bluecherry_base_environment ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root @@ -104,7 +104,7 @@ RUN rm -rf .ccache \ # --------------------------------------------------------------------------- # Install the bluecherry app and dependencies -FROM baseos as bluecherry_install +#FROM baseos as bluecherry_install ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root @@ -272,7 +272,7 @@ EXPOSE 7001/tcp 7002/tcp #ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 -FROM os_dev_environment as bluecherry_build_cleaned +#FROM os_dev_environment as bluecherry_build_cleaned ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root From 11452eabeb68151895377393c9673f9cdc648758 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 14:03:17 -0500 Subject: [PATCH 40/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1ba1d24c..a5f53229 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -75,7 +75,7 @@ jobs: id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: bluecherrydvr/bluecherry-server + images: bluecherrydvr/bluecherry - name: Build and push Docker image uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 From fa8d9e3b8da86a370768c76f053bbac5ab2f6790 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 14:17:57 -0500 Subject: [PATCH 41/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a5f53229..3399bc25 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -41,17 +41,17 @@ jobs: - name: Print running docker containers run: docker ps -# push_to_registries: -# - name: Push Docker image to multiple registries -# runs-on: ubuntu-latest -# permissions: -# packages: write -# contents: read - #steps: - - name: Check out the repo + push_to_registries: + #- name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo uses: actions/checkout@v3 - - name: Get the mysql host + - name: Get the mysql host # runs-on: ubuntu-latest id: get_host run: | From 5ba9ef644ea7e7d3719cbe04d35784d474ffc27d Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 14:23:15 -0500 Subject: [PATCH 42/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 41 ++++++++-------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3399bc25..b8361ff5 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,37 +49,20 @@ jobs: contents: read steps: - name: Check out the repo - uses: actions/checkout@v3 - - - name: Get the mysql host -# runs-on: ubuntu-latest - id: get_host - run: | - #host=`docker network inspect -f '{{(index .IPAM.Config 0).Gateway}}' bridge` - #echo "db-host=$host" >> $GITHUB_OUTPUT - #echo "$db-host" - #sudo apt -y install mysql-client - #sudo systemctl start mysql.service -# sleep 10 -# mysql -uroot --password=test -h ${{ steps.get_host.outputs.db-host }} --port ${{ job.services.mysql.ports['3306'] }} -e 'show databases;' -# - name: Push to Docker Hub -# runs-on: ubuntu-latest - - - name: Log in to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a - with: + uses: actions/checkout@v3 + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: username: curtishall - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: images: bluecherrydvr/bluecherry - - - name: Build and push Docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: + - name: Build and push Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: context: . file: ./server/Dockerfile push: true From 3ec53b2018dd6dc6a7d5914c970c576419545e68 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 17:15:35 -0500 Subject: [PATCH 43/72] Update Dockerfile --- server/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index d4e80bb3..54f718bf 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -262,12 +262,7 @@ EXPOSE 7001/tcp 7002/tcp # logs to be received by the docker engine (and read via `docker logs` , etc.) #COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf -# Make the previously copied scripts executable -#RUN chmod +x /entrypoint.sh \ -# && chmod +x /bin/bc-database-create \ -# && chmod +x /bin/bc-database-upgrade -#CMD "/entrypoint.sh" #ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 From 9c0db1669a33a2abe8dddc7bdea1824953af6a2a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 17:20:17 -0500 Subject: [PATCH 44/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b8361ff5..c0282792 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -67,6 +67,4 @@ jobs: file: ./server/Dockerfile push: true tags: testing - labels: testinglabel - - + labels: testinglabel From a657eeaaa3aeee059e75dfd3ca41064971a19b84 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 17:41:16 -0500 Subject: [PATCH 45/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c0282792..547ff5ba 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -51,7 +51,7 @@ jobs: - name: Check out the repo uses: actions/checkout@v3 - name: Log in to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + uses: docker/build-push-action@v2 with: username: curtishall password: ${{ secrets.DOCKER_PASSWORD }} From 7aa4cbeaf0b5af799b8088a875fcdd4a265f4fcf Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 17:48:32 -0500 Subject: [PATCH 46/72] Update docker-publish.yml docker/build-push-action@v3 --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 547ff5ba..4816967c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -61,7 +61,7 @@ jobs: with: images: bluecherrydvr/bluecherry - name: Build and push Docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + uses: docker/build-push-action@v3 with: context: . file: ./server/Dockerfile From 31161237c3708fc7a499ba138a0b16aeeb456c56 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 18:57:32 -0500 Subject: [PATCH 47/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4816967c..dc824eab 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,5 +1,4 @@ name: Publish Docker image - on: push: # TODO: Add push type for release From 991eaf7c9362e324bb6aa8ad146facee2931e39d Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:00:02 -0500 Subject: [PATCH 48/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index dc824eab..c93915aa 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -5,6 +5,7 @@ on: # Publish `master` as Docker `latest` image. branches: - master + - mysql # Publish `v1.2.3` tags as releases. tags: From d9abdf1191ecf646f4333f83a1ac4ca865d04219 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:03:30 -0500 Subject: [PATCH 49/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c93915aa..07a7e029 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,7 +49,7 @@ jobs: contents: read steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to Docker Hub uses: docker/build-push-action@v2 with: @@ -66,5 +66,5 @@ jobs: context: . file: ./server/Dockerfile push: true - tags: testing + tags: bluecherrydvr/bluecherry:latest labels: testinglabel From 6fbf15b55ad0dbe5363aacf1cdb42c613d456291 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:05:14 -0500 Subject: [PATCH 50/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 07a7e029..411a66df 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,7 +49,7 @@ jobs: contents: read steps: - name: Check out the repo - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Log in to Docker Hub uses: docker/build-push-action@v2 with: @@ -61,7 +61,7 @@ jobs: with: images: bluecherrydvr/bluecherry - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: context: . file: ./server/Dockerfile From 093238a8f7352b11a7d729679fca934ae5469d66 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:23:52 -0500 Subject: [PATCH 51/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 411a66df..6a36c1ca 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,7 +63,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v4 with: - context: . + context: ./server/ file: ./server/Dockerfile push: true tags: bluecherrydvr/bluecherry:latest From 1daa6584ed911a573ff005c776062d55690ebde4 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:25:57 -0500 Subject: [PATCH 52/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6a36c1ca..14432f48 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -61,10 +61,11 @@ jobs: with: images: bluecherrydvr/bluecherry - name: Build and push Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v4 with: - context: ./server/ - file: ./server/Dockerfile + working-directory: server/ + context: . + file: Dockerfile push: true tags: bluecherrydvr/bluecherry:latest labels: testinglabel From 979b0566d2533058e16467118ada3017fc314346 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:27:11 -0500 Subject: [PATCH 53/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 14432f48..49fac3f7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,9 +63,9 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v4 with: - working-directory: server/ - context: . - file: Dockerfile + #working-directory: server/ + context: ./server + file: ./server/Dockerfile push: true tags: bluecherrydvr/bluecherry:latest labels: testinglabel From b3c2b8f883b34a8005ffffe3c6e04aa8023ac1a5 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:30:33 -0500 Subject: [PATCH 54/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 49fac3f7..d5401d17 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -60,12 +60,14 @@ jobs: uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: bluecherrydvr/bluecherry + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Build and push Docker image uses: docker/build-push-action@v4 with: #working-directory: server/ - context: ./server - file: ./server/Dockerfile + context: "{{defaultContext}}:server" +# file: ./server/Dockerfile push: true tags: bluecherrydvr/bluecherry:latest labels: testinglabel From c0cfc1a04b2bfe12063e664a818111d0639b910a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 19:33:31 -0500 Subject: [PATCH 55/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d5401d17..93c4f3aa 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -50,24 +50,24 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub uses: docker/build-push-action@v2 with: username: curtishall password: ${{ secrets.DOCKER_PASSWORD }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: bluecherrydvr/bluecherry - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 +# - name: Extract metadata (tags, labels) for Docker +# id: meta +# uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 +# with: +# images: bluecherrydvr/bluecherry - name: Build and push Docker image uses: docker/build-push-action@v4 with: #working-directory: server/ context: "{{defaultContext}}:server" # file: ./server/Dockerfile - push: true + # push: true tags: bluecherrydvr/bluecherry:latest labels: testinglabel From 5ce4300f7e3b4c792c5ded7fc9cdeb103f7e67ba Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 20:47:21 -0500 Subject: [PATCH 56/72] Create Dockerfile --- Dockerfile | 304 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..231a61a3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,304 @@ +# This really belongs in server/. however some github actions do not like it in a sub directory + +# set a base image with environment to build from +FROM ubuntu:20.04 AS baseos +#RUN echo $DB_HOST +#ARG DB_HOST=$BLUECHERRY_DB_HOST +#RUN echo $BLUECHERRY_DB_HOST + +ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-latest +#ARG MYSQLHOST +#ENV MYSQL_HOST=MYSQLHOST + +#RUN echo "Testing github network env" +#RUN echo ${{ steps.github-network.outputs.gateway-address }} +RUN echo $MYSQL_HOST + +# --------------------------------------------------------------------------- +# Build the base OS with some development libs and tools +FROM baseos AS os_dev_environment +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +CMD ["echo", "Testing mysql connection via nmap..."] + +RUN apt-get update +RUN apt-get -y install nmap +#RUN nmap mysql -p 3306 + +CMD ["echo", "Installing other stuff..."] + +#RUN apt-get install --no-install-recommends -y \ +# git sudo openssl ca-certificates wget gnupg gnupg2 gnupg1 \ +# ssl-cert nmap curl sysstat iproute2 \ +# autoconf automake libtool build-essential gcc g++ \ +# debhelper ccache bison flex texinfo yasm cmake + +#RUN apt-get install --no-install-recommends -y \ +# libbsd-dev libopencv-dev libudev-dev libva-dev \ +# linux-image-generic linux-headers-generic \ +# libmysqlclient-dev rsyslog + +CMD ["echo", "Testing mysql connection..."] + +RUN apt install -y mysql-client +#RUN ip a +RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' + + +# --------------------------------------------------------------------------- +#FROM os_dev_environment as bluecherry_base_environment +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +#RUN git clone --progress --depth 1 \ +# http://github.com/bluecherrydvr/bluecherry-apps.git \ +# && cd bluecherry-apps \ +# && git checkout $BLUECHERRY_GIT_BRANCH_TAG + +#RUN apt-get --no-install-recommends -y install \ +# libbsd0 libc6 libgcc1 libssl1.1 libstdc++6 libudev1 \ +# zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver + +CMD ["echo", "**************** NMAP output..."] +RUN apt-get update +RUN apt-get -y install nmap +RUN nmap 127.0.0.1 -p 3306 + +CMD ["echo", "Installing other stuff..."] + +RUN apt install -y --no-install-recommends wget sudo gnupg +#RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add - +RUN apt update + +#RUN apt-get --no-install-recommends -y install \ +# php-mail php-mail-mime php-net-smtp php-gd php-curl \ +# php-mysql php-sqlite3 \ +# mysql-client sqlite3 + +# --------------------------------------------------------------------------- +# Build the bluecherry app and dependencies. This is done in a separate +# image because there are many ways it can fail and then we save time +# by being able to reuse prior containers leading up to this build. +#FROM bluecherry_base_environment as bluecherry_build +#ENV DEBIAN_FRONTEND=noninteractive +#WORKDIR /root + +#COPY depends/onvif_tool bluecherry-apps/utils/onvif_tool + +#RUN cd bluecherry-apps \ +# && ./scripts/build_pkg_native.sh + + +# --------------------------------------------------------------------------- +#FROM bluecherry_build as bluecherry_build_cleaned +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +RUN rm -rf /usr/src/linux-headers-* + +RUN rm -rf .ccache \ + && rm -rf bluecherry-apps/.git \ + && rm -rf bluecherry-apps/misc/libav \ + && rm -rf bluecherry-apps/misc/libconfig \ + && rm -rf bluecherry-apps/misc/pugixml + + +# --------------------------------------------------------------------------- +# Install the bluecherry app and dependencies +#FROM baseos as bluecherry_install +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +#COPY --from=bluecherry_build_cleaned \ +# /root/bluecherry-apps/releases/bluecherry_*.deb \ +# /root/bluecherry-apps/releases/ +RUN apt update +#RUN apt install --no-install-recommends -y wget mariadb-client libopencv-core libopencv-imgcodecs libopencv-imgproc libva-drm2 libva2 mkvtoolnix php-mail php-mail-mime \# +# php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2 +RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 curl \ + libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \ + php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver mysql-client python3-pip + + + +#RUN wget https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb +RUN curl -k -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb + +#COPY depends/bluecherry_3.1.0-rc8_amd64.deb /tmp/bluecherry_3.1.0-rc8_amd64.deb + +# This step is needed if/when building a new bluecherry docker container +# that will connect to an existing bluecherry database. In this case, the +# bluecherry installer will see the existing database, and it needs the +# /etc/bluecherry.conf file to tell it that it is okay to connect to (and +# modify) that database +# +#COPY bluecherry.conf /etc/bluecherry.conf + +ARG MYSQL_ADMIN_LOGIN=root +ARG MYSQL_ADMIN_PASSWORD=root + +# Specific database credentials used by bluecherry server +ARG BLUECHERRY_DB_USER=bluecherry +ARG BLUECHERRY_DB_HOST=172.17.0.1 +ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 +ARG BLUECHERRY_DB_NAME=bluecherry +ARG BLUECHERRY_DB_ACCESS_HOST='%' + +# User and Group info used for running bluecherry server processes +ARG BLUECHERRY_LINUX_GROUP_NAME=bluecherry +ARG BLUECHERRY_LINUX_GROUP_ID=1000 +ARG BLUECHERRY_LINUX_USER_NAME=bluecherry +ARG BLUECHERRY_LINUX_USER_ID=1000 + +RUN apt-get update \ + && apt-get install -y \ + wget sudo rsyslog nmap curl sysstat iproute2 \ + openssl ca-certificates ssl-cert gnupg gnupg2 gnupg1 + +#COPY my.cnf /root/.my.cnf + +#RUN { \ +# echo "[client]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysql]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysqldump]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysqldiff]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# } > /root/.my.cnf + +# NOTE: The line "export host=$BLUECHERRY_DB_HOST" ... This is required +# due to a weird global check of this env var by the "check_mysql_admin" +# function in /usr/share/bluecherry/bc_db_tool.sh ... which doesn't accept +# the db host as an argument like most of the other functions in that file. +# --- The Specific problem line is: +# if ! echo "show databases" | mysql_wrapper -h"${host}" -u"$MYSQL_ADMIN_LOGIN" &>/dev/null +# +#RUN { \ +# echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ +# echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ +# echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \ +## echo bluecherry bluecherry/db_host string mysql \ +# echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \ +# echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \ +# echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \ +# echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \ +# } | debconf-set-selections \ +# && export host=mysql \ +# && export host=$BLUECHERRY_DB_HOST \ +# && dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb + +RUN apt install -y php-curl php-gd + +RUN { \ + echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ + echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ + echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \ + echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \ + echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \ + echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \ + echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \ + } | debconf-set-selections \ +# && export DB_HOST="mysql" \ +# && export HOST=mysql \ +&& dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb + + + +# Cleanup tasks +RUN apt-get clean \ +# && rm -f bluecherry-apps/releases/bluecherry_*.deb \ + && rm -rf /var/lib/apt/lists/* + +# Remove these files -- we needed them to build the docker image, since the +# bluecherry installer scripts interact with the database. However, once the +# image is created, we expect it to receive all of the settings/credentials +# from environment variables passed in by docker or docker-compose. +#RUN rm -f /root/.my.cnf \ +RUN rm -f /etc/bluecherry.conf + +# When running rsyslog in a container, we need to disable imklog +# since the in-container process won't be allowed access to it. +#RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf + +RUN /usr/sbin/groupadd -rf \ + --gid=$BLUECHERRY_LINUX_GROUP_ID \ + $BLUECHERRY_LINUX_GROUP_NAME \ + && /usr/sbin/useradd -rm \ + --comment "Bluecherry DVR" \ + --home-dir=/var/lib/bluecherry \ + --gid=$BLUECHERRY_LINUX_GROUP_NAME \ + --groups=audio,video,render \ + --uid=$BLUECHERRY_LINUX_USER_ID \ + $BLUECHERRY_LINUX_USER_NAME \ + || echo "bluecherry user already exists" + +RUN mkdir /recordings \ + && chown bluecherry:bluecherry /recordings + +EXPOSE 7001/tcp 7002/tcp + +# This is the main script that runs as process ID 1 in the docker container +#COPY server/entrypoint.sh /entrypoint.sh + +# These scripts are wrappers used to manage the bluecherry database. They are +# necessary because the bluecherry installer usually sets up the database, but +# with a pre-built docker image the installer isn't run (so these actions have +# to be done manually as needed from the docker container... example usage +# from the docker host looks like: +# +# --- CREATE: sudo docker-compose run bluecherry bc-database-create +# --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade +#COPY server/bc-database-create.sh /bin/bc-database-create +#COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade + +# This copies in a modified rsyslog config, which tells rsyslog to route +# bluecherry logs to both /var/log/bluecherry.log (within the container) and +# also to the STDOUT of container process with PID 1, which then allows the +# logs to be received by the docker engine (and read via `docker logs` , etc.) +#COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf + + + + +#ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 + +#FROM os_dev_environment as bluecherry_build_cleaned +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +RUN rm -rf /usr/src/linux-headers-* + + +# This is the main script that runs as process ID 1 in the docker container +COPY server/entrypoint.sh /entrypoint.sh + +# These scripts are wrappers used to manage the bluecherry database. They are +# necessary because the bluecherry installer usually sets up the database, but +# with a pre-built docker image the installer isn't run (so these actions have +# to be done manually as needed from the docker container... example usage +# from the docker host looks like: +# +# --- CREATE: sudo docker-compose run bluecherry bc-database-create +# --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade +COPY server/bc-database-create.sh /bin/bc-database-create +COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade + +# This copies in a modified rsyslog config, which tells rsyslog to route +# bluecherry logs to both /var/log/bluecherry.log (within the container) and +# also to the STDOUT of container process with PID 1, which then allows the +# logs to be received by the docker engine (and read via `docker logs` , etc.) +COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf + +# Make the previously copied scripts executable +RUN chmod +x /entrypoint.sh \ + && chmod +x /bin/bc-database-create \ + && chmod +x /bin/bc-database-upgrade + +CMD "/entrypoint.sh" From cfe772ad0f0a8221bc9b1ea4c7e53c0b45927c6b Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 20:50:54 -0500 Subject: [PATCH 57/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 93c4f3aa..989bd2e2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -50,6 +50,8 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v3 + - name: Wait for mysql + run: sleep 15 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub From bd6f01200826648981c2dde6e4bfa5efea398f86 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 20:53:03 -0500 Subject: [PATCH 58/72] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 231a61a3..2bf709c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client #RUN ip a -RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' +#RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' # --------------------------------------------------------------------------- From 914697b3076d6f074f26f3263e97fe056f4b4b52 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 20:59:36 -0500 Subject: [PATCH 59/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 989bd2e2..bbd44c7c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -25,21 +25,7 @@ jobs: - uses: actions/checkout@v2 - name: Shutdown existing MySQL run: sudo service mysql stop - - name: Set up MySQL - uses: cweinberger/github-actions-mysql@main - with: - version: 5.7 - hostPort: 3306 - containerPort: 3306 - rootPassword: root - user: TestUser - password: TestPassword - database: TestDatabase - characterSet: utf8mb4 - collation: utf8mb4_general_ci - sqlMode: NO_ENGINE_SUBSTITUTION - - name: Print running docker containers - run: docker ps + push_to_registries: #- name: Push Docker image to multiple registries @@ -48,6 +34,22 @@ jobs: packages: write contents: read steps: + - name: Set up MySQL + uses: cweinberger/github-actions-mysql@main + with: + version: 5.7 + hostPort: 3306 + containerPort: 3306 + rootPassword: root + user: TestUser + password: TestPassword + database: TestDatabase + characterSet: utf8mb4 + collation: utf8mb4_general_ci + sqlMode: NO_ENGINE_SUBSTITUTION + + - name: Print running docker containers + run: docker ps - name: Check out the repo uses: actions/checkout@v3 - name: Wait for mysql From 9b8bcf8e5294bc0fe6a042f0c13653f5ab018f23 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 21:03:57 -0500 Subject: [PATCH 60/72] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2bf709c5..529383a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -277,7 +277,7 @@ RUN rm -rf /usr/src/linux-headers-* # This is the main script that runs as process ID 1 in the docker container -COPY server/entrypoint.sh /entrypoint.sh +COPY ./server/entrypoint.sh /entrypoint.sh # These scripts are wrappers used to manage the bluecherry database. They are # necessary because the bluecherry installer usually sets up the database, but @@ -294,7 +294,7 @@ COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade # bluecherry logs to both /var/log/bluecherry.log (within the container) and # also to the STDOUT of container process with PID 1, which then allows the # logs to be received by the docker engine (and read via `docker logs` , etc.) -COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf +COPY ./server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf # Make the previously copied scripts executable RUN chmod +x /entrypoint.sh \ From 8045fc221bbbcee75c8f82ed5d846846d4aa0a68 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 21:09:20 -0500 Subject: [PATCH 61/72] Update Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 529383a1..4d81e86b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -294,6 +294,7 @@ COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade # bluecherry logs to both /var/log/bluecherry.log (within the container) and # also to the STDOUT of container process with PID 1, which then allows the # logs to be received by the docker engine (and read via `docker logs` , etc.) +RUN ls -l /etc/rsyslog.d COPY ./server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf # Make the previously copied scripts executable From 24022079f6942251d9a9bb853e121d9cb1edfc4c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 21:12:49 -0500 Subject: [PATCH 62/72] Update Dockerfile --- server/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 54f718bf..b9e410b5 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -292,7 +292,8 @@ COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade # bluecherry logs to both /var/log/bluecherry.log (within the container) and # also to the STDOUT of container process with PID 1, which then allows the # logs to be received by the docker engine (and read via `docker logs` , etc.) -COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf +RUN ls -l /etc/rsyslog.d +COPY ./server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf # Make the previously copied scripts executable RUN chmod +x /entrypoint.sh \ From 1a17304ee828db5956ca154f6c6c176713f526fb Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 21:17:49 -0500 Subject: [PATCH 63/72] Update Dockerfile --- server/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index b9e410b5..e71a9cdc 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -292,8 +292,8 @@ COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade # bluecherry logs to both /var/log/bluecherry.log (within the container) and # also to the STDOUT of container process with PID 1, which then allows the # logs to be received by the docker engine (and read via `docker logs` , etc.) -RUN ls -l /etc/rsyslog.d -COPY ./server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf +RUN ls -ltrd /etc/rsyslog.d +COPY bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf # Make the previously copied scripts executable RUN chmod +x /entrypoint.sh \ From 844da94d389e0a5c7145a7b9e0a12ba124ae09eb Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 21:21:08 -0500 Subject: [PATCH 64/72] Update Dockerfile --- server/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index e71a9cdc..18417f47 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -275,7 +275,7 @@ RUN rm -rf /usr/src/linux-headers-* # This is the main script that runs as process ID 1 in the docker container -COPY server/entrypoint.sh /entrypoint.sh +COPY entrypoint.sh /entrypoint.sh # These scripts are wrappers used to manage the bluecherry database. They are # necessary because the bluecherry installer usually sets up the database, but @@ -285,8 +285,8 @@ COPY server/entrypoint.sh /entrypoint.sh # # --- CREATE: sudo docker-compose run bluecherry bc-database-create # --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade -COPY server/bc-database-create.sh /bin/bc-database-create -COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade +COPY bc-database-create.sh /bin/bc-database-create +COPY bc-database-upgrade.sh /bin/bc-database-upgrade # This copies in a modified rsyslog config, which tells rsyslog to route # bluecherry logs to both /var/log/bluecherry.log (within the container) and From df2443181a48a091eb8fd3e5842240fd11474d98 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 1 Aug 2023 21:48:28 -0500 Subject: [PATCH 65/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index bbd44c7c..7c55f46f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -56,11 +56,11 @@ jobs: run: sleep 15 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Log in to Docker Hub - uses: docker/build-push-action@v2 - with: - username: curtishall - password: ${{ secrets.DOCKER_PASSWORD }} +# - name: Log in to Docker Hub +# uses: docker/build-push-action@v2 +# with: +# username: curtishall +# password: ${{ secrets.DOCKER_PASSWORD }} # - name: Extract metadata (tags, labels) for Docker # id: meta # uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 @@ -71,6 +71,8 @@ jobs: with: #working-directory: server/ context: "{{defaultContext}}:server" + username: curtishall + password: ${{ secrets.DOCKER_PASSWORD }} # file: ./server/Dockerfile # push: true tags: bluecherrydvr/bluecherry:latest From 511fa8831ae5f54d480d5384d4152119ac670824 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 2 Aug 2023 09:39:59 -0500 Subject: [PATCH 66/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7c55f46f..f2d9983d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -56,11 +56,13 @@ jobs: run: sleep 15 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 -# - name: Log in to Docker Hub -# uses: docker/build-push-action@v2 -# with: -# username: curtishall -# password: ${{ secrets.DOCKER_PASSWORD }} + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + # username: curtishall + # password: ${{ secrets.DOCKER_PASSWORD }} # - name: Extract metadata (tags, labels) for Docker # id: meta # uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 @@ -71,8 +73,8 @@ jobs: with: #working-directory: server/ context: "{{defaultContext}}:server" - username: curtishall - password: ${{ secrets.DOCKER_PASSWORD }} + # username: curtishall + # password: ${{ secrets.DOCKER_PASSWORD }} # file: ./server/Dockerfile # push: true tags: bluecherrydvr/bluecherry:latest From 8a19ab0d70aa7de0c610c3a25ebec769cfafda39 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 2 Aug 2023 09:43:54 -0500 Subject: [PATCH 67/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f2d9983d..3ac1b0d3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -76,6 +76,6 @@ jobs: # username: curtishall # password: ${{ secrets.DOCKER_PASSWORD }} # file: ./server/Dockerfile - # push: true + push: true tags: bluecherrydvr/bluecherry:latest labels: testinglabel From b4b89cc5a81c2e146fd43a27fcb19156df95aeb2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 2 Aug 2023 10:22:15 -0500 Subject: [PATCH 68/72] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3ac1b0d3..147ec09a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -77,5 +77,5 @@ jobs: # password: ${{ secrets.DOCKER_PASSWORD }} # file: ./server/Dockerfile push: true - tags: bluecherrydvr/bluecherry:latest - labels: testinglabel + tags: bluecherrydvr/bluecherry:citesting + labels: github_ci From b74c36c9eaeead0d689761356c2c01f35bf9951e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 2 Aug 2023 19:00:13 -0500 Subject: [PATCH 69/72] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 09033f06..27ab2a35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: TZ: $TZ bluecherry: - image: bluecherrydvr/bluecherry:latest + image: bluecherrydvr/bluecherry:citesting container_name: bc-server cap_add: - NET_BIND_SERVICE From dfe10826bd60a3cd345c6b5570ba2b7f62dbc33a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 2 Aug 2023 19:35:53 -0500 Subject: [PATCH 70/72] Update Dockerfile RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 18417f47..9a49b5bc 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -223,7 +223,7 @@ RUN rm -f /etc/bluecherry.conf # When running rsyslog in a container, we need to disable imklog # since the in-container process won't be allowed access to it. -#RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf +RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf RUN /usr/sbin/groupadd -rf \ --gid=$BLUECHERRY_LINUX_GROUP_ID \ From 40fcc3cc2ba8e5255d1172a3237f56a262514f17 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 2 Aug 2023 19:46:20 -0500 Subject: [PATCH 71/72] Update entrypoint.sh --- server/entrypoint.sh | 58 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/server/entrypoint.sh b/server/entrypoint.sh index 20f03493..4464b877 100644 --- a/server/entrypoint.sh +++ b/server/entrypoint.sh @@ -55,20 +55,62 @@ echo "> /usr/sbin/rsyslogd" /usr/sbin/rsyslogd status=$? if [ $status -ne 0 ]; then - echo "Failed to start apache2 web server: $status" + echo "Failed to start rsyslog: $status" exit $status fi +entrypoint_log() { + if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then + echo "$@" + fi +} -echo "> /usr/sbin/apache2" -source /etc/apache2/envvars -/usr/sbin/apache2 -status=$? -if [ $status -ne 0 ]; then - echo "Failed to start apache2 web server: $status" - exit $status +if [ "$1" = "nginx" ] || [ "$1" = "nginx-debug" ]; then + if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then + entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" + + entrypoint_log "$0: Looking for shell scripts in /docker-entrypoint.d/" + find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do + case "$f" in + *.envsh) + if [ -x "$f" ]; then + entrypoint_log "$0: Sourcing $f"; + . "$f" + else + # warn on shell scripts without exec bit + entrypoint_log "$0: Ignoring $f, not executable"; + fi + ;; + *.sh) + if [ -x "$f" ]; then + entrypoint_log "$0: Launching $f"; + "$f" + else + # warn on shell scripts without exec bit + entrypoint_log "$0: Ignoring $f, not executable"; + fi + ;; + *) entrypoint_log "$0: Ignoring $f";; + esac + done + + entrypoint_log "$0: Configuration complete; ready for start up" + else + entrypoint_log "$0: No files found in /docker-entrypoint.d/, skipping configuration" + fi fi +exec "$@" + +#echo "> /usr/sbin/nginx" +#source /etc/apache2/envvars +#/usr/sbin/apache2 +#status=$? +#if [ $status -ne 0 ]; then +# echo "Failed to start apache2 web server: $status" +# exit $status +#fi + echo "> /usr/sbin/bc-server -u bluecherry -g bluecherry" export LD_LIBRARY_PATH=/usr/lib/bluecherry From d1f235dfa617a620f1e4d89f09733f42f4f0132e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 2 Aug 2023 22:25:13 -0500 Subject: [PATCH 72/72] Add files via upload --- server/Dockerfile-working | 303 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 303 insertions(+) create mode 100644 server/Dockerfile-working diff --git a/server/Dockerfile-working b/server/Dockerfile-working new file mode 100644 index 00000000..9a49b5bc --- /dev/null +++ b/server/Dockerfile-working @@ -0,0 +1,303 @@ +# set a base image with environment to build from +FROM ubuntu:20.04 AS baseos +#RUN echo $DB_HOST +#ARG DB_HOST=$BLUECHERRY_DB_HOST +#RUN echo $BLUECHERRY_DB_HOST + +ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-latest +#ARG MYSQLHOST +#ENV MYSQL_HOST=MYSQLHOST + +#RUN echo "Testing github network env" +#RUN echo ${{ steps.github-network.outputs.gateway-address }} +RUN echo $MYSQL_HOST + +# --------------------------------------------------------------------------- +# Build the base OS with some development libs and tools +FROM baseos AS os_dev_environment +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +CMD ["echo", "Testing mysql connection via nmap..."] + +RUN apt-get update +RUN apt-get -y install nmap +#RUN nmap mysql -p 3306 + +CMD ["echo", "Installing other stuff..."] + +#RUN apt-get install --no-install-recommends -y \ +# git sudo openssl ca-certificates wget gnupg gnupg2 gnupg1 \ +# ssl-cert nmap curl sysstat iproute2 \ +# autoconf automake libtool build-essential gcc g++ \ +# debhelper ccache bison flex texinfo yasm cmake + +#RUN apt-get install --no-install-recommends -y \ +# libbsd-dev libopencv-dev libudev-dev libva-dev \ +# linux-image-generic linux-headers-generic \ +# libmysqlclient-dev rsyslog + +CMD ["echo", "Testing mysql connection..."] + +RUN apt install -y mysql-client +#RUN ip a +RUN mysql -uroot -proot -h 172.17.0.1 -e 'SELECT version()' + + +# --------------------------------------------------------------------------- +#FROM os_dev_environment as bluecherry_base_environment +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +#RUN git clone --progress --depth 1 \ +# http://github.com/bluecherrydvr/bluecherry-apps.git \ +# && cd bluecherry-apps \ +# && git checkout $BLUECHERRY_GIT_BRANCH_TAG + +#RUN apt-get --no-install-recommends -y install \ +# libbsd0 libc6 libgcc1 libssl1.1 libstdc++6 libudev1 \ +# zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver + +CMD ["echo", "**************** NMAP output..."] +RUN apt-get update +RUN apt-get -y install nmap +RUN nmap 127.0.0.1 -p 3306 + +CMD ["echo", "Installing other stuff..."] + +RUN apt install -y --no-install-recommends wget sudo gnupg +#RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add - +RUN apt update + +#RUN apt-get --no-install-recommends -y install \ +# php-mail php-mail-mime php-net-smtp php-gd php-curl \ +# php-mysql php-sqlite3 \ +# mysql-client sqlite3 + +# --------------------------------------------------------------------------- +# Build the bluecherry app and dependencies. This is done in a separate +# image because there are many ways it can fail and then we save time +# by being able to reuse prior containers leading up to this build. +#FROM bluecherry_base_environment as bluecherry_build +#ENV DEBIAN_FRONTEND=noninteractive +#WORKDIR /root + +#COPY depends/onvif_tool bluecherry-apps/utils/onvif_tool + +#RUN cd bluecherry-apps \ +# && ./scripts/build_pkg_native.sh + + +# --------------------------------------------------------------------------- +#FROM bluecherry_build as bluecherry_build_cleaned +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +RUN rm -rf /usr/src/linux-headers-* + +RUN rm -rf .ccache \ + && rm -rf bluecherry-apps/.git \ + && rm -rf bluecherry-apps/misc/libav \ + && rm -rf bluecherry-apps/misc/libconfig \ + && rm -rf bluecherry-apps/misc/pugixml + + +# --------------------------------------------------------------------------- +# Install the bluecherry app and dependencies +#FROM baseos as bluecherry_install +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +#COPY --from=bluecherry_build_cleaned \ +# /root/bluecherry-apps/releases/bluecherry_*.deb \ +# /root/bluecherry-apps/releases/ +RUN apt update +#RUN apt install --no-install-recommends -y wget mariadb-client libopencv-core libopencv-imgcodecs libopencv-imgproc libva-drm2 libva2 mkvtoolnix php-mail php-mail-mime \# +# php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2 +RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 curl \ + libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \ + php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver mysql-client python3-pip + + + +#RUN wget https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb +RUN curl -k -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb + +#COPY depends/bluecherry_3.1.0-rc8_amd64.deb /tmp/bluecherry_3.1.0-rc8_amd64.deb + +# This step is needed if/when building a new bluecherry docker container +# that will connect to an existing bluecherry database. In this case, the +# bluecherry installer will see the existing database, and it needs the +# /etc/bluecherry.conf file to tell it that it is okay to connect to (and +# modify) that database +# +#COPY bluecherry.conf /etc/bluecherry.conf + +ARG MYSQL_ADMIN_LOGIN=root +ARG MYSQL_ADMIN_PASSWORD=root + +# Specific database credentials used by bluecherry server +ARG BLUECHERRY_DB_USER=bluecherry +ARG BLUECHERRY_DB_HOST=172.17.0.1 +ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 +ARG BLUECHERRY_DB_NAME=bluecherry +ARG BLUECHERRY_DB_ACCESS_HOST='%' + +# User and Group info used for running bluecherry server processes +ARG BLUECHERRY_LINUX_GROUP_NAME=bluecherry +ARG BLUECHERRY_LINUX_GROUP_ID=1000 +ARG BLUECHERRY_LINUX_USER_NAME=bluecherry +ARG BLUECHERRY_LINUX_USER_ID=1000 + +RUN apt-get update \ + && apt-get install -y \ + wget sudo rsyslog nmap curl sysstat iproute2 \ + openssl ca-certificates ssl-cert gnupg gnupg2 gnupg1 + +#COPY my.cnf /root/.my.cnf + +#RUN { \ +# echo "[client]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysql]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysqldump]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysqldiff]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# } > /root/.my.cnf + +# NOTE: The line "export host=$BLUECHERRY_DB_HOST" ... This is required +# due to a weird global check of this env var by the "check_mysql_admin" +# function in /usr/share/bluecherry/bc_db_tool.sh ... which doesn't accept +# the db host as an argument like most of the other functions in that file. +# --- The Specific problem line is: +# if ! echo "show databases" | mysql_wrapper -h"${host}" -u"$MYSQL_ADMIN_LOGIN" &>/dev/null +# +#RUN { \ +# echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ +# echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ +# echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \ +## echo bluecherry bluecherry/db_host string mysql \ +# echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \ +# echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \ +# echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \ +# echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \ +# } | debconf-set-selections \ +# && export host=mysql \ +# && export host=$BLUECHERRY_DB_HOST \ +# && dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb + +RUN apt install -y php-curl php-gd + +RUN { \ + echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ + echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ + echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \ + echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \ + echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \ + echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \ + echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \ + } | debconf-set-selections \ +# && export DB_HOST="mysql" \ +# && export HOST=mysql \ +&& dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb + + + +# Cleanup tasks +RUN apt-get clean \ +# && rm -f bluecherry-apps/releases/bluecherry_*.deb \ + && rm -rf /var/lib/apt/lists/* + +# Remove these files -- we needed them to build the docker image, since the +# bluecherry installer scripts interact with the database. However, once the +# image is created, we expect it to receive all of the settings/credentials +# from environment variables passed in by docker or docker-compose. +#RUN rm -f /root/.my.cnf \ +RUN rm -f /etc/bluecherry.conf + +# When running rsyslog in a container, we need to disable imklog +# since the in-container process won't be allowed access to it. +RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf + +RUN /usr/sbin/groupadd -rf \ + --gid=$BLUECHERRY_LINUX_GROUP_ID \ + $BLUECHERRY_LINUX_GROUP_NAME \ + && /usr/sbin/useradd -rm \ + --comment "Bluecherry DVR" \ + --home-dir=/var/lib/bluecherry \ + --gid=$BLUECHERRY_LINUX_GROUP_NAME \ + --groups=audio,video,render \ + --uid=$BLUECHERRY_LINUX_USER_ID \ + $BLUECHERRY_LINUX_USER_NAME \ + || echo "bluecherry user already exists" + +RUN mkdir /recordings \ + && chown bluecherry:bluecherry /recordings + +EXPOSE 7001/tcp 7002/tcp + +# This is the main script that runs as process ID 1 in the docker container +#COPY server/entrypoint.sh /entrypoint.sh + +# These scripts are wrappers used to manage the bluecherry database. They are +# necessary because the bluecherry installer usually sets up the database, but +# with a pre-built docker image the installer isn't run (so these actions have +# to be done manually as needed from the docker container... example usage +# from the docker host looks like: +# +# --- CREATE: sudo docker-compose run bluecherry bc-database-create +# --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade +#COPY server/bc-database-create.sh /bin/bc-database-create +#COPY server/bc-database-upgrade.sh /bin/bc-database-upgrade + +# This copies in a modified rsyslog config, which tells rsyslog to route +# bluecherry logs to both /var/log/bluecherry.log (within the container) and +# also to the STDOUT of container process with PID 1, which then allows the +# logs to be received by the docker engine (and read via `docker logs` , etc.) +#COPY server/bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf + + + + +#ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 + +#FROM os_dev_environment as bluecherry_build_cleaned +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +RUN rm -rf /usr/src/linux-headers-* + + +# This is the main script that runs as process ID 1 in the docker container +COPY entrypoint.sh /entrypoint.sh + +# These scripts are wrappers used to manage the bluecherry database. They are +# necessary because the bluecherry installer usually sets up the database, but +# with a pre-built docker image the installer isn't run (so these actions have +# to be done manually as needed from the docker container... example usage +# from the docker host looks like: +# +# --- CREATE: sudo docker-compose run bluecherry bc-database-create +# --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade +COPY bc-database-create.sh /bin/bc-database-create +COPY bc-database-upgrade.sh /bin/bc-database-upgrade + +# This copies in a modified rsyslog config, which tells rsyslog to route +# bluecherry logs to both /var/log/bluecherry.log (within the container) and +# also to the STDOUT of container process with PID 1, which then allows the +# logs to be received by the docker engine (and read via `docker logs` , etc.) +RUN ls -ltrd /etc/rsyslog.d +COPY bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf + +# Make the previously copied scripts executable +RUN chmod +x /entrypoint.sh \ + && chmod +x /bin/bc-database-create \ + && chmod +x /bin/bc-database-upgrade + +CMD "/entrypoint.sh"