uvdesk / community-skeleton

UVdesk Opensource Community Helpdesk Project built for all to make a Full Ticketing Support System along with many more other features.
https://www.uvdesk.com
MIT License
7.15k stars 449 forks source link

Docker image issue #726

Open saikrishna1488 opened 4 months ago

saikrishna1488 commented 4 months ago

Getting below error when i used the docker but the image has build successfully.

`exec /usr/local/bin/uvdesk-entrypoint.sh: no image such file or directory

And used below docker command

docker run -dit -p 9999:80 -e MYSQL_USER=stage -e MYSQL_ROOT_PASSWORD=stage -e MYSQL_PASSWORD=stage -e MYSQL_DATABASE=stage --name uvdesk uvdesk

I-Am-Skoot commented 1 month ago

I ran into the same issue, so I sent the output of the build to a log file here are the highlights.

of note: step 8 GPG key retrieval times out.

#8 125.4 Processing triggers for dbus (1.12.2-1ubuntu1.4) ...
#8 416.9 Error: retrieving gpg key timed out.
#8 911.2 /usr/bin/gpg
#8 DONE 911.9s

step 14 Commands not Found

#14 [ 9/10] RUN     a2enmod php7.4 rewrite;     chmod +x /usr/local/bin/uvdesk-entrypoint.sh;     dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')";     wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-$dpkgArch"     && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/1.11/gosu-$dpkgArch.asc";     export GNUPGHOME="$(mktemp -d)"     && gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4    && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu     && gpgconf --kill all     && chmod +x /usr/local/bin/gosu     && gosu nobody true;         wget -O /usr/local/bin/composer.php "https://getcomposer.org/installer";     actualSig="$(wget -q -O - https://composer.github.io/installer.sig)";     currentSig="$(shasum -a 384 /usr/local/bin/composer.php | awk '{print $1}')";     if [ "$currentSig" != "$actualSig" ]; then         echo "Warning: Failed to verify composer signature.";         exit 1;       fi;     php /usr/local/bin/composer.php --quiet --filename=/usr/local/bin/composer     && chmod +x /usr/local/bin/composer;     chown -R uvdesk:uvdesk /var/www;     rm -rf         "$GNUPGHOME"         /var/lib/apt/lists/*         /usr/local/bin/gosu.asc         /usr/local/bin/composer.php         /var/www/bin         /var/www/html         /var/www/uvdesk/.docker;
#14 0.974 /bin/sh: 1: a2enmod: not found
#14 1.065 /bin/sh: 1: wget: not found
#14 1.068 gpg: keybox '/tmp/tmp.zUMCFt3yVg/pubring.kbx' created
#14 17.73 gpg: /tmp/tmp.zUMCFt3yVg/trustdb.gpg: trustdb created
#14 17.73 gpg: key 036A9C25BF357DD4: public key "Tianon Gravi <tianon@tianon.xyz>" imported
#14 17.74 gpg: Total number processed: 1
#14 17.74 gpg:               imported: 1
#14 17.74 gpg: can't open '/usr/local/bin/gosu.asc': No such file or directory
#14 17.74 gpg: verify signatures failed: No such file or directory
#14 17.74 /bin/sh: 1: wget: not found
#14 17.74 /bin/sh: 1: wget: not found
#14 17.74 /bin/sh: 1: shasum: not found
#14 17.74 /bin/sh: 1: php: not found
Darkaguila commented 1 month ago

The problem is that the Dockerfile uses Ubuntu version 18.04, which currently doesn't have support. Therefore, when trying to install PHP 7.4, it fails, and as a result, all packages don't install successfully. You only need to change the Dockerfile to use version 20.04, and it will work. Here is and exaple of Dockerfile

FROM ubuntu:20.04
LABEL maintainer="akshay.kumar758@webkul.com"

ENV GOSU_VERSION 1.11

RUN adduser uvdesk -q --disabled-password --gecos ""

# Install base supplimentary packages
RUN apt-get update && apt-get -y upgrade \
    && apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ondrej/php \
    && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
        curl \
        wget \
        git \
        unzip \
        apache2 \
        mysql-server \
        php7.4 \
        libapache2-mod-php7.4 \
        php7.4-common \
        php7.4-xml \
        php7.4-imap \
        php7.4-mysql \
        php7.4-mailparse \
        ca-certificates; \
    if ! command -v gpg; then \
        apt-get install -y --no-install-recommends gnupg2 dirmngr; \
    elif gpg --version | grep -q '^gpg (GnuPG) 1\.'; then \
        apt-get install -y --no-install-recommends gnupg-curl; \
    fi;

COPY ./.docker/config/apache2/env /etc/apache2/envvars
COPY ./.docker/config/apache2/httpd.conf /etc/apache2/apache2.conf
COPY ./.docker/config/apache2/vhost.conf /etc/apache2/sites-available/000-default.conf
COPY ./.docker/bash/uvdesk-entrypoint.sh /usr/local/bin/
COPY . /var/www/uvdesk/

RUN \
    # Update apache configurations
    a2enmod php7.4 rewrite; \
    chmod +x /usr/local/bin/uvdesk-entrypoint.sh; \
    # Install gosu for stepping-down from root to a non-privileged user during container startup
    dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
    wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
    && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
    # Verify gosu installation
    export GNUPGHOME="$(mktemp -d)" \
    && gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
    && gpgconf --kill all \
    && chmod +x /usr/local/bin/gosu \
    && gosu nobody true; \
    \
    # Download and verify composer installer signature
    wget -O /usr/local/bin/composer.php "https://getcomposer.org/installer"; \
    actualSig="$(wget -q -O - https://composer.github.io/installer.sig)"; \
    currentSig="$(shasum -a 384 /usr/local/bin/composer.php | awk '{print $1}')"; \
    if [ "$currentSig" != "$actualSig" ]; then \
        echo "Warning: Failed to verify composer signature."; \
        exit 1; \
    fi; \
    # Install composer
    php /usr/local/bin/composer.php --quiet --filename=/usr/local/bin/composer \
    && chmod +x /usr/local/bin/composer; \
    # Assign user uvdesk the ownership of source directory
    chown -R uvdesk:uvdesk /var/www; \
    # Clean up files
    rm -rf \
        "$GNUPGHOME" \
        /var/lib/apt/lists/* \
        /usr/local/bin/gosu.asc \
        /usr/local/bin/composer.php \
        /var/www/bin \
        /var/www/html \
        /var/www/uvdesk/.docker;

# Change working directory to uvdesk source
WORKDIR /var/www

ENTRYPOINT ["uvdesk-entrypoint.sh"]
CMD ["/bin/bash"]