Custom Lamp App Cloudron Build Error
-
I'm following these instructions for building a custom app modeled off of the Lamp app but which allows multiple databases. I'm following these instructions. When I run
cloudron build --local
, after I put in my docker hub repository path, it gets most of the way through the build but then borks with the following errorThe command '/bin/bash -c apt-get -y update && apt install -y cron apache2-dev php-imagick && rm -rf /var/cache/apt /var/lib/apt/lists' returned a non-zero code: 100
I'm stuck. Help appreciated.
-
@shai Can you paste the fill docker build output and the Dockerfile as well. Usually, what you can do is that there will be an "image" hash right before this command fails. You can then "docker run -ti <imagehash> /bin/bash" and then you can run the command that fails to see why it's failing. I wonder if the issue here is that you have some network connectivity issue from inside docker containers.
-
Thanks. I don't see an image hash. Rather it fails on a GPG key.
Here is the build output
Step 1/26 : FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4 ---> afa4cfc125b4 Step 2/26 : RUN mkdir -p /app/code ---> Using cache ---> e07f49f6451d Step 3/26 : WORKDIR /app/code ---> Using cache ---> 97eeefe5d9eb Step 4/26 : RUN apt-get -y update && apt install -y cron apache2-dev php-imagick && rm -rf /var/cache/apt /var/lib/apt/lists ---> Running in a5881c83ada4 Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:2 http://dl.yarnpkg.com/debian stable InRelease [17.1 kB] Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB] Get:4 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB] Err:2 http://dl.yarnpkg.com/debian stable InRelease The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx> Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1421 kB] Get:6 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [510 kB] Get:7 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2263 kB] Get:8 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [26.7 kB] Get:9 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:10 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages [158 kB] Get:11 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:12 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB] Get:13 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB] Get:14 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB] Get:15 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB] Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [39.4 kB] Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [544 kB] Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2699 kB] Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2196 kB] Get:20 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [11.3 kB] Get:21 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [11.4 kB] Reading package lists... W: GPG error: http://dl.yarnpkg.com/debian stable InRelease: The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx> E: The repository 'http://dl.yarnpkg.com/debian stable InRelease' is not signed. The command '/bin/bash -c apt-get -y update && apt install -y cron apache2-dev php-imagick && rm -rf /var/cache/apt /var/lib/apt/lists' returned a non-zero code: 100
Here is the docker file:
FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4 RUN mkdir -p /app/code WORKDIR /app/code # required for compiling rpaf RUN apt-get -y update && apt install -y cron apache2-dev php-imagick && rm -rf /var/cache/apt /var/lib/apt/lists # configure apache RUN rm /etc/apache2/sites-enabled/* RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf COPY apache/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf COPY apache/lamp.conf /etc/apache2/sites-enabled/lamp.conf RUN echo "Listen 80" > /etc/apache2/ports.conf RUN a2disconf other-vhosts-access-log RUN a2enmod rewrite headers rewrite expires cache # configure mod_php RUN crudini --set /etc/php/7.3/apache2/php.ini PHP upload_max_filesize 64M && \ crudini --set /etc/php/7.3/apache2/php.ini PHP post_max_size 64M && \ crudini --set /etc/php/7.3/apache2/php.ini PHP memory_limit 128M && \ crudini --set /etc/php/7.3/apache2/php.ini Session session.save_path /run/app/sessions && \ crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_probability 1 && \ crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_divisor 100 RUN mv /etc/php/7.3/apache2/php.ini /etc/php/7.3/apache2/php.ini.orig && ln -sf /app/data/php.ini /etc/php/7.3/apache2/php.ini && \ mv /etc/php/7.3/cli/php.ini /etc/php/7.3/cli/php.ini.orig && ln -sf /app/data/php.ini /etc/php/7.3/cli/php.ini # install RPAF module to override HTTPS, SERVER_PORT, HTTP_HOST based on reverse proxy headers # https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-16-04-server RUN mkdir /app/code/rpaf && \ curl -L https://github.com/gnif/mod_rpaf/tarball/669c3d2ba72228134ae5832c8cf908d11ecdd770 | tar -C /app/code/rpaf -xz --strip-components 1 -f - && \ cd /app/code/rpaf && \ make && \ make install && \ rm -rf /app/code/rpaf # configure rpaf RUN echo "LoadModule rpaf_module /usr/lib/apache2/modules/mod_rpaf.so" > /etc/apache2/mods-available/rpaf.load && a2enmod rpaf # phpMyAdmin RUN mkdir -p /app/code/phpmyadmin && \ curl -L https://files.phpmyadmin.net/phpMyAdmin/4.9.4/phpMyAdmin-4.9.4-all-languages.tar.gz | tar zxvf - -C /app/code/phpmyadmin --strip-components=1 COPY phpmyadmin-config.inc.php /app/code/phpmyadmin/config.inc.php # configure cron RUN rm -rf /var/spool/cron && ln -s /run/cron /var/spool/cron # clear out the crontab RUN rm -f /etc/cron.d/* /etc/cron.daily/* /etc/cron.hourly/* /etc/cron.monthly/* /etc/cron.weekly/* && truncate -s0 /etc/crontab # ioncube. the extension dir comes from php -i | grep extension_dir # extension has to appear first, otherwise will error with "The Loader must appear as the first entry in the php.ini file" RUN mkdir /tmp/ioncube && \ curl http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz | tar zxvf - -C /tmp/ioncube && \ cp /tmp/ioncube/ioncube/ioncube_loader_lin_7.3.so /usr/lib/php/20170718 && \ rm -rf /tmp/ioncube && \ echo "zend_extension=/usr/lib/php/20170718/ioncube_loader_lin_7.3.so" > /etc/php/7.3/apache2/conf.d/00-ioncube.ini && \ echo "zend_extension=/usr/lib/php/20170718/ioncube_loader_lin_7.3.so" > /etc/php/7.3/cli/conf.d/00-ioncube.ini # configure supervisor ADD supervisor/ /etc/supervisor/conf.d/ RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf # add code COPY start.sh index.php crontab.template credentials.template phpmyadmin_login.template /app/code/ # lock www-data but allow su - www-data to work RUN passwd -l www-data && usermod --shell /bin/bash --home /app/data www-data # make cloudron exec sane WORKDIR /app/data CMD [ "/app/code/start.sh" ]
-
The problem was the GPG key for yarn.
By adding the following on line 5 of Dockerfile the problem was fixed:
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
That line did generate the following warning; you tell me if it is of concern:
Warning: apt-key output should not be parsed (stdout is not a terminal)
I've successfully installed the app on my Cloudron. Now I'm configuring the two dbs.
-
-
@girish I have installed lamp7.4-multiDB-app in my cloudron server. When I'm trying to connect MySQL database using web terminal & Windows WSL Ubuntu 20.04. I'm getting an error in lamp7.4-multiDB-app.
#Web Terminal Error: mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 2026 (HY000): SSL connection error: unknown error number #WSL Ubuntu 20.04 Error: mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
-
@arshsahzad Did you create the database after installing the app? You can create databases with a prefix of
CLOUDRON_MYSQL_DATABASE_PREFIX
. The "MySQL" button on top of the web terminal won't work immediately you have to replace the database name with the database you created previously. The MySQL button only works for single database apps. For multiple database apps, it doesn't know the name of the database. -
@girish said in Custom Lamp App Cloudron Build Error:
@arshsahzad Did you create the database after installing the app? You can create databases with a prefix of
CLOUDRON_MYSQL_DATABASE_PREFIX
. The "MySQL" button on top of the web terminal won't work immediately you have to replace the database name with the database you created previously. The MySQL button only works for single database apps. For multiple database apps, it doesn't know the name of the database.I installed the LAMP MultiDB using WSL Ubuntu 20.04 to my cloudron server after login.
cloudron install --appstore-id lamp.cloudronapp
then
cloudron exec --app test.example.com
, but when I'm tryingmysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST}
I'm getting the above-mentioned error, I don't know what to do next, I didn't created any database after installation because I'm not able to access the default created DB.
-
@arshsahzad said in Custom Lamp App Cloudron Build Error:
cloudron install --appstore-id lamp.cloudronapp
This seems incorrect. You have to
cloudron build
and thencloudron install
. With--appstore-id
you are trying to install an app from the Cloudron App Store and it's not installing the Lamp 7.4 MultiDB app you just built.I tried this now and this works for me:
root@26925401-6b67-4c07-b4f8-81f4402572ed:/app/data# env | grep PREFIX CLOUDRON_MYSQL_DATABASE_PREFIX=f6433359711935b8_ root@26925401-6b67-4c07-b4f8-81f4402572ed:/app/data# mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18989 Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu) Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE f6433359711935b8_MyNewDatabase; Query OK, 1 row affected (0.01 sec) mysql>
As seen above, I create arbitrary database with the prefix.