From 3e8e94a49b083e84fd83f38fbba80293f39802e7 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 15 Dec 2020 06:05:00 +0000 Subject: [PATCH] moved Dockerfile to the subdirectory 'docker' --- codepot/Dockerfile | 53 ------------------------------ codepot/docker/Dockerfile.ubnt2004 | 6 ++++ codepot/docker/Makefile | 2 ++ codepot/docker/build-ubnt2004.sh | 50 ++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 53 deletions(-) delete mode 100644 codepot/Dockerfile create mode 100644 codepot/docker/Dockerfile.ubnt2004 create mode 100644 codepot/docker/Makefile create mode 100755 codepot/docker/build-ubnt2004.sh diff --git a/codepot/Dockerfile b/codepot/Dockerfile deleted file mode 100644 index 85386378..00000000 --- a/codepot/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM ubuntu:20.04 - -RUN set -eux; \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - subversion mariadb-server mariadb-client apache2 \ - php libapache2-mod-php php-mysql php-gd \ - libapache2-mod-perl2 libapache2-mod-svn \ - libswitch-perl libconfig-simple-perl libdigest-sha-perl \ - libdbd-mysql-perl libnet-ldap-perl \ - php-dev libsvn-dev make && \ - \ - cd /tmp && \ - svn co http://code.miflux.com/svn/codepot/trunk/codepot && \ - cd codepot && \ - ./configure \ - --prefix=/usr \ - --libdir=/usr/lib64 \ - --sysconfdir=/etc \ - --with-wwwdir=/var/www/html/codepot \ - --with-cfgdir=/etc/codepot \ - --with-depotdir=/var/lib/codepot \ - --with-logdir=/var/log/codepot \ - --with-cachedir=/var/cache/codepot \ - --with-phpextdir=`php-config --extension-dir` \ - --with-phpextinidir=`php-config --ini-dir | sed 's|/cli/|/apache2/|g'` && \ - make && make install && \ - mkdir -p /var/lib/codepot/svnrepo /var/lib/codepot/files && \ - mkdir -p /var/cache/codepot /var/log/codepot && \ - chown -R www-data:www-data /var/lib/codepot /var/cache/codepot /var/log/codepot && \ - service mysql start && sleep 5 && \ - mysql -e 'create database codepot' && \ - mysql -e 'source /etc/codepot/codepot.mysql' codepot && \ - mysql -e 'create user "codepot"@"localhost" identified by "codepot"' && \ - mysql -e 'grant all privileges on codepot.* to "codepot"@"localhost"' && \ - sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*""$|database_hostname = "localhost"|g' \ - -e 's|^database_username[[:space:]]*=[[:space:]]*""$|database_username = "codepot"|g' \ - -e 's|^database_password[[:space:]]*=[[:space:]]*""$|database_password = "codepot"|g' \ - -e 's|^database_name[[:space:]]*=[[:space:]]*""$|database_name = "codepot"|g' \ - -e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "mysqli"|g' /etc/codepot/codepot.ini && \ - sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /usr/sbin/codepot-user && \ - sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /etc/codepot/perl/Codepot/AccessHandler.pm && \ - cd .. && \ - cd .. && \ - \ - cp -pf /etc/codepot/codepot.httpd /etc/apache2/conf-enabled/codepot.conf && \ - echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/apache2/conf-enabled/perl.conf && \ - \ - apt-get remove -y php-dev libsvn-dev make && \ - apt-get auto-remove -y && \ - rm -rf /var/lib/apt/lists/* - -CMD ["/bin/bash"] diff --git a/codepot/docker/Dockerfile.ubnt2004 b/codepot/docker/Dockerfile.ubnt2004 new file mode 100644 index 00000000..a7fb1e79 --- /dev/null +++ b/codepot/docker/Dockerfile.ubnt2004 @@ -0,0 +1,6 @@ +FROM ubuntu:20.04 + +COPY build-ubnt2004.sh /tmp +RUN /tmp/build-ubnt2004.sh && rm -rf /tmp/* + +CMD ["/bin/bash"] diff --git a/codepot/docker/Makefile b/codepot/docker/Makefile new file mode 100644 index 00000000..f6f5b9c3 --- /dev/null +++ b/codepot/docker/Makefile @@ -0,0 +1,2 @@ +all: + docker build -t codepot:ubnt20.04 -f Dockerfile.ubnt2004 . diff --git a/codepot/docker/build-ubnt2004.sh b/codepot/docker/build-ubnt2004.sh new file mode 100755 index 00000000..b4de8c04 --- /dev/null +++ b/codepot/docker/build-ubnt2004.sh @@ -0,0 +1,50 @@ +cd /tmp + +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + subversion mariadb-server mariadb-client apache2 \ + php libapache2-mod-php php-mysql php-gd \ + libapache2-mod-perl2 libapache2-mod-svn \ + libswitch-perl libconfig-simple-perl libdigest-sha-perl \ + libdbd-mysql-perl libnet-ldap-perl \ + php-dev libsvn-dev make + +svn co http://code.miflux.com/svn/codepot/trunk/codepot && \ +cd codepot && \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib64 \ + --sysconfdir=/etc \ + --with-wwwdir=/var/www/html/codepot \ + --with-cfgdir=/etc/codepot \ + --with-depotdir=/var/lib/codepot \ + --with-logdir=/var/log/codepot \ + --with-cachedir=/var/cache/codepot \ + --with-phpextdir=`php-config --extension-dir` \ + --with-phpextinidir=`php-config --ini-dir | sed 's|/cli/|/apache2/|g'` && \ +make && make install && \ +mkdir -p /var/lib/codepot/svnrepo /var/lib/codepot/files && \ +mkdir -p /var/cache/codepot /var/log/codepot && \ +chown -R www-data:www-data /var/lib/codepot /var/cache/codepot /var/log/codepot && \ +service mysql start && sleep 5 && \ +mysql -e 'create database codepot' && \ +mysql -e 'source /etc/codepot/codepot.mysql' codepot && \ +mysql -e 'create user "codepot"@"localhost" identified by "codepot"' && \ +mysql -e 'grant all privileges on codepot.* to "codepot"@"localhost"' && \ +sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*""$|database_hostname = "localhost"|g' \ + -e 's|^database_username[[:space:]]*=[[:space:]]*""$|database_username = "codepot"|g' \ + -e 's|^database_password[[:space:]]*=[[:space:]]*""$|database_password = "codepot"|g' \ + -e 's|^database_name[[:space:]]*=[[:space:]]*""$|database_name = "codepot"|g' \ + -e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "mysqli"|g' /etc/codepot/codepot.ini && \ +sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /usr/sbin/codepot-user && \ +sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /etc/codepot/perl/Codepot/AccessHandler.pm && \ +cd .. && \ +cd .. && \ +\ +cp -pf /etc/codepot/codepot.httpd /etc/apache2/conf-enabled/codepot.conf && \ +echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/apache2/conf-enabled/perl.conf + + + +apt-get remove -y php-dev libsvn-dev make && \ +apt-get auto-remove -y && rm -rf /var/lib/apt/lists/*