-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openboxes-docker out update #16
Comments
Same, I have tried on multiple targets (armv7 with a different mysql image, amd64 on Ubuntu and macOS) without luck. Here’s the log when building the image:
|
Managed to go forward with this but now I’m stuck on issue #10. Here’s my modified Dockerfile: FROM openjdk:7-jdk
MAINTAINER Michael Seaton <mseaton@pih.org>
# Environment variables
ENV SDKMAN_DIR /root/.sdkman
ENV GRAILS_VERSION 1.3.9
# Install Base Packages required and Node
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN rm /etc/apt/sources.list
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 7638D0442B90D010
RUN echo "deb http://archive.debian.org/debian/ jessie main" | tee -a /etc/apt/sources.list
RUN echo "deb-src http://archive.debian.org/debian/ jessie main" | tee -a /etc/apt/sources.list
RUN echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
RUN echo 'Package: *\nPin: origin "archive.debian.org"\nPin-Priority: 500' | tee -a /etc/apt/preferences.d/10-archive-pin
RUN apt-get update
RUN apt-get install -y --force-yes aptitude
RUN aptitude install -y --allow-untrusted curl zip python g++ make gcc build-essential apt-transport-https lsb-release
#RUN apt-get update && apt-get install -y curl zip python g++ make gcc build-essential \
RUN curl -sL https://deb.nodesource.com/setup_13.x | bash - \
RUN aptitude install -y nodejs \
RUN curl -L https://www.npmjs.com/install.sh | sh
# Install Grails and Set Path
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN curl -s "https://get.sdkman.io" | bash
RUN chmod a+x "$SDKMAN_DIR/bin/sdkman-init.sh"
# change timeout and max time based on your liking and internet speed
RUN set -x \
&& echo "sdkman_auto_answer=true" > $SDKMAN_DIR/etc/config \
&& echo "sdkman_auto_selfupdate=false" >> $SDKMAN_DIR/etc/config \
&& echo "sdkman_curl_connect_timeout=20" >> $SDKMAN_DIR/etc/config \
&& echo "sdkman_curl_max_time=0" >> $SDKMAN_DIR/etc/config \
&& echo "sdkman_insecure_ssl=false" >> $SDKMAN_DIR/etc/config
WORKDIR $SDKMAN_DIR
RUN [[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh" && exec "$@"
RUN source /root/.bashrc
# install and set grails version
RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk install grails $GRAILS_VERSION"
RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk default grails $GRAILS_VERSION"
# set envs
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
ENV GRAILS_HOME /root/.sdkman/candidates/grails/current
ENV PATH $GRAILS_HOME/bin:$PATH
ENV GRAILS_OPTS -XX:-UseSplitVerifier -Xverify:none
# Set the directory that an existing Grails app should be mounted into with a volume
RUN mkdir /app
WORKDIR /app
EXPOSE 8080
CMD ["grails"] |
I was able to update the dockerfile to get OpenBoxes running. This is a longer-form walk through of my process in case it helps people for future issues - feel free to skip to the end, and please let me know if it works for you too! Diagnosing/Update Process
Updated Dockerfile# Azul image is more modern/better maintained
#FROM openjdk:7-jdk
FROM azul/zulu-openjdk:7
MAINTAINER Michael Seaton <mseaton@pih.org>
# Environment variables
ENV SDKMAN_DIR /root/.sdkman
ENV GRAILS_VERSION 1.3.9
ENV NODE_VERSION=14.0.0
# Install Base Packages required
RUN apt-get update && apt-get install -y curl zip python2 g++ make gcc build-essential
# Download node + extract
RUN curl -LO https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz &&\
tar -xvf node-v${NODE_VERSION}-linux-x64.tar.xz
# Update our PATH to include the node binary
ENV PATH=${PATH}:/node-v${NODE_VERSION}-linux-x64/bin
# Install Grails and Set Path
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN curl -s "https://get.sdkman.io" | bash
RUN chmod a+x "$SDKMAN_DIR/bin/sdkman-init.sh"
# change timeout and max time based on your liking and internet speed
RUN set -x \
&& echo "sdkman_auto_answer=true" > $SDKMAN_DIR/etc/config \
&& echo "sdkman_auto_selfupdate=false" >> $SDKMAN_DIR/etc/config \
&& echo "sdkman_curl_connect_timeout=20" >> $SDKMAN_DIR/etc/config \
&& echo "sdkman_curl_max_time=0" >> $SDKMAN_DIR/etc/config \
&& echo "sdkman_insecure_ssl=false" >> $SDKMAN_DIR/etc/config
WORKDIR $SDKMAN_DIR
RUN [[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh" && exec "$@"
RUN source /root/.bashrc
# install and set grails version
RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk install grails $GRAILS_VERSION"
RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk default grails $GRAILS_VERSION"
# set envs
ENV JAVA_HOME /usr/lib/jvm/zulu7-ca-amd64
ENV GRAILS_HOME /root/.sdkman/candidates/grails/current
ENV PATH $GRAILS_HOME/bin:$PATH
# Memory settings were required or else things would fail with OOM errors or stall forever
ENV GRAILS_OPTS -XX:MaxPermSize=8192m -Xmx8192M -XX:-UseSplitVerifier -Xverify:none
# Set the directory that an existing Grails app should be mounted into with a volume
RUN mkdir /app
WORKDIR /app
EXPOSE 8080
CMD ["grails"] Updated openboxes-run.sh file#!/bin/bash
# grails doesn't run without it for some reason
export GRAILS_OPTS="-XX:MaxPermSize=8192m -Xmx8192M -XX:-UseSplitVerifier -Xverify:none"
if [ ! -f /app/web-app/WEB-INF/applicationContext.xml ]; then
echo "Forcing grails upgrade"
grails upgrade --force --stacktrace
fi
npm cache clean --force
npm cache verify
npm i -g npm@6.14.6
npm config set engine-strict true
# npm update
# some dependencies don't get resolved on thier own
npm i --no-package-lock --legacy-peer-deps --force --verbose --stacktrace
grails run-app --stacktrace
# if you want to compile enable this and stop grails run-app
# grails -Dgrails.env=staging war Running
|
Im stuck at Building React frontend and there is no output after that. I used the Dockerfile and openboxes-run.sh by @ookjosh. I tried to CTRL+C and tried again but still gets stuck at "Building React frontend" |
@JZafarr Thank you so much for testing this, and I'm sorry that it didn't work. I was able to reproduce your issue, and have a fix that should at least move things forward for now. Apparently I had done something in openboxes before using the docker setup and that "fixed" things for me. It requires node/npm on your host, so if that's not feasible please let me know. Hope it helps! Short answerOn your host, do the following:
Longer answernpm has a feature (that has since been removed, apparently) where if it runs as root it will actually take on the GID/UID of the owner of the folder it is in. Since this docker compose setup works by mounting a directory on your filesystem into the container, npm uses your user info. However, this causes conflicts for when npm needs to build C++ dependencies because write permissions are borked. I debugged this issue by getting a shell into the container via Thoughts on this setupIt's possible to have the container adopt the user's UID/GID instead of running as root, which has the advantage of not leaving root-owned files in the project folder. We'd have to do some reshuffling of the existing setup to move away from root-owned resources, but it shouldn't be too bad I think. This should also fix the npm error. Otherwise, we could consider copying the openboxes assets into the image and running/installing there, but the downside to this is that the files are then not available for easy editing on the host. It would be more of a build/deploy step than anything. |
@ookjosh Thanks for the detailed response, I will try this and will let you know how it comes along. |
@ookjosh Thanks for the guide. Unfortunately, I still hit the "Building react frontend" error inspite of following your fix. I had to run "npm run bundle" outside the container (On the host) and comment out the same within _Events.groovy file to get this working. |
Is downgrading the host NODE version required to execute these commands? @anudr01d I have to run Research points to having too high a node version for this to run properly. Is downgrading node required? |
I tried.
--> I saw colorful warning..... I was scared, but I had courage.
And next, follow @ookjosh 's instruction. React build finished ` ` Of course, I've updated Dockerfile and openboxes-run.sh file. Thank you everyone. |
I have setup on docker but debian not support. Help me
The text was updated successfully, but these errors were encountered: