updating docker build procedures

This commit is contained in:
hyung-hwan 2021-09-07 07:01:20 +00:00
parent e5060bcbe4
commit 19b380cee0
3 changed files with 25 additions and 21 deletions

View File

@ -1,5 +1,14 @@
FROM ubuntu:20.04 FROM ubuntu:20.04
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
subversion mariadb-server mariadb-client apache2 \
php libapache2-mod-php php-gd php-sqlite3 \
libapache2-mod-perl2 libapache2-mod-svn \
libswitch-perl libconfig-simple-perl libdigest-sha-perl \
libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl \
sqlite3 php-dev libsvn-dev make vim
COPY build-ubnt2004.sh /tmp COPY build-ubnt2004.sh /tmp
RUN /tmp/build-ubnt2004.sh && rm -rf /tmp/* RUN /tmp/build-ubnt2004.sh && rm -rf /tmp/*

View File

@ -1,13 +1,14 @@
cd /tmp cd /tmp
apt-get update && #apt update &&
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ #DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
subversion mariadb-server mariadb-client apache2 \ # subversion mariadb-server mariadb-client apache2 \
php libapache2-mod-php php-mysql php-gd \ # php libapache2-mod-php php-gd php-sqlite3 \
libapache2-mod-perl2 libapache2-mod-svn \ # libapache2-mod-perl2 libapache2-mod-svn \
libswitch-perl libconfig-simple-perl libdigest-sha-perl \ # libswitch-perl libconfig-simple-perl libdigest-sha-perl \
libdbd-mysql-perl libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl \ # libdbd-sqlite3-perl libnet-ldap-perl libsvn-perl libmail-sendmail-perl \
php-dev libsvn-dev make # sqlite3 php-dev libsvn-dev make vim
svn co http://code.miflux.com/svn/codepot/trunk/codepot && \ svn co http://code.miflux.com/svn/codepot/trunk/codepot && \
cd codepot && \ cd codepot && \
@ -25,17 +26,11 @@ cd codepot && \
make && make install && \ make && make install && \
mkdir -p /var/lib/codepot/svnrepo /var/lib/codepot/files && \ mkdir -p /var/lib/codepot/svnrepo /var/lib/codepot/files && \
mkdir -p /var/cache/codepot /var/log/codepot && \ mkdir -p /var/cache/codepot /var/log/codepot && \
sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db "" && \
chown -R www-data:www-data /var/lib/codepot /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 && \ sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*"localhost"$|database_hostname = "/var/lib/codepot/codepot.db"|g' \
mysql -e 'create database codepot' && \ -e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "sqlite"|g' \
mysql -e 'source /etc/codepot/codepot.mysql' codepot && \ -e 's|^database_use_pdo[[:space:]]*=[[:space:]]*"no"$|database_use_pdo = "yes"|g' /etc/codepot/codepot.ini && \
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' /usr/sbin/codepot-user && \
sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /etc/codepot/perl/Codepot/AccessHandler.pm && \ sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /etc/codepot/perl/Codepot/AccessHandler.pm && \
install -m 0755 -D -t /usr/sbin docker/apache2-fg.sh && \ install -m 0755 -D -t /usr/sbin docker/apache2-fg.sh && \
@ -57,7 +52,7 @@ cat <<EOF > /var/www/html/index.html
</html> </html>
EOF EOF
apt-get remove --purge -y --allow-remove-essential php-dev libsvn-dev make libfdisk1 && \ apt remove --purge -y --allow-remove-essential php-dev libsvn-dev make libfdisk1 && \
apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/* apt autoremove --purge -y && rm -rf /var/lib/apt/lists/*
rm -rf /root/.subversion rm -rf /root/.subversion

View File

@ -69,8 +69,8 @@ database_username = ""
database_password = "" database_password = ""
database_name = "" database_name = ""
database_driver = "" database_driver = ""
database_prefix = ""
database_use_pdo = "no" database_use_pdo = "no"
database_prefix = ""
database_store_gmt = "yes" database_store_gmt = "yes"
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------