-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Resource not found by Assets controller #43
Comments
I haven't tested the build on Mac yet, so maybe there's some issue. Before I dive in, I need to ask: |
Thank you for your response. No I did not pass BASE_HREF for the docker build... I am using the default “/“ . Steps I followed:
|
Also I was wondering which environment did you test the docker build on. Also would it really matter since everything is happening in the container and not on the host. The reason I am trying to build the image myself and not pull from docker hub is because , the docker image is trying to access /src and /app... which require root access. We are running our containers in Openshift and our openshift cluster does not allow access to root paths. So the only change I made to Dockerfile is to use /tmp/src and /tmp/app and not /src and /app |
FROM node:11.15.0-alpine as npm ENV SBT_VERSION=1.2.8 ENV SBT_GPG_KEY=99E82A75642AC823 ENV DOCKERIZE_VERSION=0.6.1 ENV BASE_HREF="/" RUN apk --no-cache add git=2.20.2-r0 RUN mkdir -p /tmp/src /tmp/app WORKDIR /tmp/src RUN git clone https://github.com/elkozmon/zoonavigator.git WORKDIR /tmp/src/zoonavigator RUN git clone https://github.com/elkozmon/zoonavigator-api.git RUN git clone https://github.com/elkozmon/zoonavigator-web.git RUN cp -r zoonavigator-web/* . RUN cp -r build/docker/files/zoonavigator-web/* . RUN apk --no-cache add tar=1.32-r0 curl=7.64.0-r3 python2-dev=2.7.16-r1 make=4.2.1-r2 g++=8.3.0-r0 RUN curl RUN dockerize RUN npm install -g @angular/cli@8.3.20 FROM openjdk:8u151-jdk-alpine3.7 as sbt ENV SBT_VERSION=1.2.8 ENV SBT_GPG_KEY=99E82A75642AC823 RUN apk --no-cache add git=2.15.4-r0 WORKDIR /tmp/src RUN git clone https://github.com/elkozmon/zoonavigator.git WORKDIR /tmp/src/zoonavigator RUN git clone https://github.com/elkozmon/zoonavigator-api.git RUN git clone https://github.com/elkozmon/zoonavigator-web.git RUN cp -r zoonavigator-api/* . COPY --from=npm /tmp/app ./play/public RUN apk --no-cache add aria2=1.33.1-r1 gnupg=2.2.3-r1 ca-certificates=20190108-r0 bash=4.4.19-r1 SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN sbt play/dist FROM openjdk:14-jdk-slim ENV BASE_HREF="/" ENV HTTP_PORT=9000 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update WORKDIR /tmp/src RUN git clone https://github.com/elkozmon/zoonavigator.git WORKDIR /tmp/src/zoonavigator RUN git clone https://github.com/elkozmon/zoonavigator-api.git RUN git clone https://github.com/elkozmon/zoonavigator-web.git WORKDIR /tmp/app RUN groupadd -g 1000 zoonavigator USER zoonavigator:zoonavigator COPY --chown=zoonavigator:zoonavigator --from=sbt /tmp/app . COPY --chown=zoonavigator:zoonavigator --from=npm /usr/local/bin/dockerize /usr/local/bin/dockerize RUN cp -r /tmp/src/zoonavigator/build/docker/files/zoonavigator-api/* . RUN cp -r /tmp/src/zoonavigator/build/docker/files/zoonavigator-web/* . RUN chown -R zoonavigator:zoonavigator ./* RUN dockerize HEALTHCHECK --interval=30s --timeout=3s EXPOSE 9000 ENTRYPOINT ["./run.sh"] |
Sorry for the late reply. I have tested the Docker build on macOS (with original Dockerfile) and it worked well, so it seems it is related to changes you made. Anyway, if the root of your issue is the root access, I think we should fix that in this repository, rather then fixing your custom Dockerfile, so other users on OpenShift won't have the same problem. Do you agree? Would it suffice to change the directory permissions as described in the OpenShift guidelines?
If so I can make the changes for you in this repository. |
The latest build is now capable of running as an arbitrary non-privileged user. Please let me know if there are any more issues. |
I am able to successfully build the image with the Dockerfile provided on Mac OS. On running that image with the following command:
docker run -p 9000:9000 --name zoonavigator --restart unless-stopped zoonavigator
and then going to 0.0.0.0:9000 I get the following 404 http error:
{"success":false,"message":"Resource not found by Assets controller"}
Please help about how to fix it.
The text was updated successfully, but these errors were encountered: