openmpf / openmpf-docker

OpenMPF Docker deployment files and other artifacts
https://hub.docker.com/u/openmpf
5 stars 2 forks source link

Failure to build image for ./openmpf_build/Dockerfile at r8.0.0 #212

Open w3sip opened 2 months ago

w3sip commented 2 months ago

Seems to error out here ... any way to work around this?

The command ran was

docker buildx build --platform "linux/amd64" \
   -t openmpf_build:8.0.0 \
   --file $OPENMPFTMP/openmpf/openmpf_build/Dockerfile \
   .
 => ERROR [build 12/16] RUN --mount=type=cache,id=mvn_cache,target=/root/.m2/repository,sharing=private     --mount=type=tmpfs,target=/tmp     0.9s
------
 > [build 12/16] RUN --mount=type=cache,id=mvn_cache,target=/root/.m2/repository,sharing=private     --mount=type=tmpfs,target=/tmp     --mount=type=tmpfs,target=/root/.cache     mvn package         -DskipTests -Dmaven.test.skip=true -DskipITs         -Dcomponents.build.components=''         -Dstartup.auto.registration.skip=false         -Dcomponents.build.parallel.builds="$(nproc)"         -Dcomponents.build.make.jobs="$(nproc)";     mkdir --parents /build-artifacts/mvn/mpf;     mv /root/.m2/repository/org/mitre/mpf /build-artifacts/mvn;:
#0 0.804 [INFO] Scanning for projects...
#0 0.825 [INFO] ------------------------------------------------------------------------
#0 0.825 [INFO] BUILD FAILURE
#0 0.825 [INFO] ------------------------------------------------------------------------
#0 0.825 [INFO] Total time: 0.031 s
#0 0.826 [INFO] Finished at: 2024-04-30T00:13:25+00:00
#0 0.834 [INFO] Final Memory: 9M/136M
#0 0.834 [INFO] ------------------------------------------------------------------------
#0 0.835 [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/mpf/openmpf-projects/openmpf). Please verify you invoked Maven from the correct directory. -> [Help 1]
#0 0.835 [ERROR]
#0 0.835 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
#0 0.835 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
#0 0.835 [ERROR]
#0 0.835 [ERROR] For more information about the errors and possible solutions, please read the following articles:
#0 0.835 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
------
Dockerfile:160
--------------------
 159 |
 160 | >>> RUN --mount=type=cache,id=mvn_cache,target=/root/.m2/repository,sharing=private \
 161 | >>>     --mount=type=tmpfs,target=/tmp \
 162 | >>>     --mount=type=tmpfs,target=/root/.cache \
 163 | >>>     mvn package \
 164 | >>>         -DskipTests -Dmaven.test.skip=true -DskipITs \
 165 | >>>         -Dcomponents.build.components='' \
 166 | >>>         -Dstartup.auto.registration.skip=false \
 167 | >>>         -Dcomponents.build.parallel.builds="$(nproc)" \
 168 | >>>         -Dcomponents.build.make.jobs="$(nproc)"; \
 169 | >>>     mkdir --parents /build-artifacts/mvn/mpf; \
 170 | >>>     # Move mpf artifacts out of Maven repo so they won't be in the cache mount when another build is started
 171 | >>>     mv /root/.m2/repository/org/mitre/mpf /build-artifacts/mvn;
 172 |
--------------------
ERROR: failed to solve: process "/bin/bash -o errexit -o pipefail -c mvn package         -DskipTests -Dmaven.test.skip=true -DskipITs         -Dcomponents.build.components=''         -Dstartup.auto.registration.skip=false         -Dcomponents.build.parallel.builds=\"$(nproc)\"         -Dcomponents.build.make.jobs=\"$(nproc)\";     mkdir --parents /build-artifacts/mvn/mpf;     mv /root/.m2/repository/org/mitre/mpf /build-artifacts/mvn;" did not complete successfully: exit code: 1
jrobble commented 2 months ago

Are you following these instructions?

Screenshot 2024-05-01 at 9 03 54 AM

First, you should have the complete openmpf-projects repo cloned and checked out (including all of the submodules). The above command uses .. within openmpf-projects/openmpf-docker which means the build context is actually the parent dir, which is just openmpf-projects.

Here's the operation in the Dockerfile that copies the entire openmpf-projects repo.

I think the reason your build failed is because you either don't have the complete openmpf-projects repo cloned or you ran the build command from the wrong dir.