tiredofit / docker-osticket

Dockerized help desk application
MIT License
71 stars 56 forks source link

Missing "/usr/src/plugins/*.phar" files during docker build process #25

Closed davidlorius closed 1 year ago

davidlorius commented 1 year ago

I followed the instructions to build the docker image based on the Dockerfile of this repo, but during the process, I obtained the same output as the last GitHub Actions output on the last build execution:

 > [3/4] RUN set -x &&     cd /usr/src/plugins &&     php make.php hydrate &&     for plugin in $(find * -maxdepth 0 -type d ! -path doc ! -path lib); do cp -r ${plugin} /assets/install/include/plugins; done;     cp -R /usr/src/plugins/*.phar /assets/install/include/plugins/ &&     cd / &&         git clone https://github.com/clonemeagain/osticket-plugin-archiver /assets/install/include/plugins/archiver &&     git clone https://github.com/clonemeagain/attachment_preview /assets/install/include/plugins/attachment-preview &&     git clone https://github.com/clonemeagain/plugin-autocloser /assets/install/include/plugins/auto-closer &&     git clone https://github.com/bkonetzny/osticket-fetch-note /assets/install/include/plugins/fetch-note &&     git clone https://github.com/Micke1101/OSTicket-plugin-field-radiobuttons /assets/install/include/plugins/field-radiobuttons &&     git clone https://github.com/clonemeagain/osticket-plugin-mentioner /assets/install/include/plugins/mentioner &&     git clone https://github.com/philbertphotos/osticket-multildap-auth /assets/install/include/plugins/multi-ldap &&     mv /assets/install/include/plugins/multi-ldap/multi-ldap/* /assets/install/include/plugins/multi-ldap/ &&     rm -rf /assets/install/include/plugins/multi-ldap/multi-ldap &&     git clone https://github.com/clonemeagain/osticket-plugin-preventautoscroll /assets/install/include/plugins/prevent-autoscroll &&     git clone https://github.com/clonemeagain/plugin-fwd-rewriter /assets/install/include/plugins/rewriter &&     git clone https://github.com/clonemeagain/osticket-slack /assets/install/include/plugins/slack &&     git clone https://github.com/ipavlovi/osTicket-Microsoft-Teams-plugin /assets/install/include/plugins/teams &&         touch /var/log/msmtp.log &&     chown nginx:www-data /var/log/msmtp.log &&        apt-get clean &&     rm -rf /var/lib/apt/lists/* &&     rm -rf /tmp/* &&     rm -rf /usr/src/* &&     rm -rf /root/.composer/cache:
#0 0.279 + ' ' cd /usr/src/plugins
#0 0.279 /bin/bash: line 1:  : command not found
#0 0.279 + cp -R '/usr/src/plugins/*.phar' /assets/install/include/plugins/
#0 0.280 cp: cannot stat '/usr/src/plugins/*.phar': No such file or directory
------
WARNING: buildx: failed to get git commit: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Dockerfile:52
--------------------
  51 |         git clone -b develop https://github.com/osTicket/osTicket-plugins /usr/src/plugins
  52 | >>> RUN set -x && \    cd /usr/src/plugins && \
  53 | >>>     php make.php hydrate && \
  54 | >>>     for plugin in $(find * -maxdepth 0 -type d ! -path doc ! -path lib); do cp -r ${plugin} /assets/install/include/plugins; done; \
  55 | >>>     cp -R /usr/src/plugins/*.phar /assets/install/include/plugins/ && \
  56 | >>>     cd / && \
  57 | >>>     \
  58 | >>> # Add Community Plugins
  59 | >>>     ## Archiver
  60 | >>>     git clone https://github.com/clonemeagain/osticket-plugin-archiver /assets/install/include/plugins/archiver && \
  61 | >>>     ## Attachment Preview
  62 | >>>     git clone https://github.com/clonemeagain/attachment_preview /assets/install/include/plugins/attachment-preview && \
  63 | >>>     ## Auto Closer
  64 | >>>     git clone https://github.com/clonemeagain/plugin-autocloser /assets/install/include/plugins/auto-closer && \
  65 | >>>     ## Fetch Note
  66 | >>>     git clone https://github.com/bkonetzny/osticket-fetch-note /assets/install/include/plugins/fetch-note && \
  67 | >>>     ## Field Radio Buttons
  68 | >>>     git clone https://github.com/Micke1101/OSTicket-plugin-field-radiobuttons /assets/install/include/plugins/field-radiobuttons && \
  69 | >>>     ## Mentioner
  70 | >>>     git clone https://github.com/clonemeagain/osticket-plugin-mentioner /assets/install/include/plugins/mentioner && \
  71 | >>>     ## Multi LDAP Auth
  72 | >>>     git clone https://github.com/philbertphotos/osticket-multildap-auth /assets/install/include/plugins/multi-ldap && \
  73 | >>>     mv /assets/install/include/plugins/multi-ldap/multi-ldap/* /assets/install/include/plugins/multi-ldap/ && \
  74 | >>>     rm -rf /assets/install/include/plugins/multi-ldap/multi-ldap && \
  75 | >>>     ## Prevent Autoscroll
  76 | >>>     git clone https://github.com/clonemeagain/osticket-plugin-preventautoscroll /assets/install/include/plugins/prevent-autoscroll && \
  77 | >>>     ## Rewriter
  78 | >>>     git clone https://github.com/clonemeagain/plugin-fwd-rewriter /assets/install/include/plugins/rewriter && \
  79 | >>>     ## Slack
  80 | >>>     git clone https://github.com/clonemeagain/osticket-slack /assets/install/include/plugins/slack && \
  81 | >>>     ## Teams (Microsoft)
  82 | >>>     git clone https://github.com/ipavlovi/osTicket-Microsoft-Teams-plugin /assets/install/include/plugins/teams && \
  83 | >>>     \
  84 | >>> ### Log Miscellany Installation
  85 | >>>     touch /var/log/msmtp.log && \
  86 | >>>     chown nginx:www-data /var/log/msmtp.log && \
  87 | >>>    \
  88 | >>> ## Cleanup
  89 | >>>     apt-get clean && \
  90 | >>>     rm -rf /var/lib/apt/lists/* && \
  91 | >>>     rm -rf /tmp/* && \
  92 | >>>     rm -rf /usr/src/* && \
  93 | >>>     rm -rf /root/.composer/cache
  94 |     
--------------------
ERROR: failed to solve: process "/bin/bash -c set -x && \\    cd /usr/src/plugins &&     php make.php hydrate &&     for plugin in $(find * -maxdepth 0 -type d ! -path doc ! -path lib); do cp -r ${plugin} /assets/install/include/plugins; done;     cp -R /usr/src/plugins/*.phar /assets/install/include/plugins/ &&     cd / &&         git clone https://github.com/clonemeagain/osticket-plugin-archiver /assets/install/include/plugins/archiver &&     git clone https://github.com/clonemeagain/attachment_preview /assets/install/include/plugins/attachment-preview &&     git clone https://github.com/clonemeagain/plugin-autocloser /assets/install/include/plugins/auto-closer &&     git clone https://github.com/bkonetzny/osticket-fetch-note /assets/install/include/plugins/fetch-note &&     git clone https://github.com/Micke1101/OSTicket-plugin-field-radiobuttons /assets/install/include/plugins/field-radiobuttons &&     git clone https://github.com/clonemeagain/osticket-plugin-mentioner /assets/install/include/plugins/mentioner &&     git clone https://github.com/philbertphotos/osticket-multildap-auth /assets/install/include/plugins/multi-ldap &&     mv /assets/install/include/plugins/multi-ldap/multi-ldap/* /assets/install/include/plugins/multi-ldap/ &&     rm -rf /assets/install/include/plugins/multi-ldap/multi-ldap &&     git clone https://github.com/clonemeagain/osticket-plugin-preventautoscroll /assets/install/include/plugins/prevent-autoscroll &&     git clone https://github.com/clonemeagain/plugin-fwd-rewriter /assets/install/include/plugins/rewriter &&     git clone https://github.com/clonemeagain/osticket-slack /assets/install/include/plugins/slack &&     git clone https://github.com/ipavlovi/osTicket-Microsoft-Teams-plugin /assets/install/include/plugins/teams &&         touch /var/log/msmtp.log &&     chown nginx:www-data /var/log/msmtp.log &&        apt-get clean &&     rm -rf /var/lib/apt/lists/* &&     rm -rf /tmp/* &&     rm -rf /usr/src/* &&     rm -rf /root/.composer/cache" did not complete successfully: exit code: 1
davidlorius commented 1 year ago

In a past commit, we have this change: https://github.com/tiredofit/docker-osticket/commit/c3cd5baea3b2b0b6159a96e51303b285f9e2942d#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R51-R52

And that breaks the process of Docker because the /usr/src/plugins path doesn't persist to the next step; I'm proposing a patch to solve that, only removing the RUN set -x && \\ part and continuing with the "one-line" command and should success the process to obtain the OSTicket image.

tiredofit commented 1 year ago

Ahh that looks like my development process crept into the final Dockerfile there. You are correct - The additional RUN statement is making the rest of the build process "forget" what it had already done. I can remove it for you quickly enough.

tiredofit commented 1 year ago

Going to give this image some love and get it up to date - Give me 5 minutes.

tiredofit commented 1 year ago

There you go - 3.5.0 modernizes the image a bit and gives you some flex in how you are setting and changing versions. You can mix and match some php versions and if you really wanted to, use another OS (Alpine) although we had some issues with that in the past.

Let me know if you encounter any other issues..

davidlorius commented 1 year ago

Thank you so much!!