RobotecAI / RGLGazeboPlugin

Other
61 stars 11 forks source link

Add Dockerfile to simplify build process #40

Closed ruffsl closed 4 months ago

ruffsl commented 4 months ago

I've added a few more commits to demonstrate the issues with the existing CMake.

```shell > docker build \ --target=exporter \ --output=build . [+] Building 6.3s (12/14) docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.11kB 0.0s => [internal] load metadata for docker.io/library/ros:jazzy 1.5s => [internal] load .dockerignore 0.0s => => transferring context: 210B 0.0s => [base 1/2] FROM docker.io/library/ros:jazzy@sha256:ee4862fe098e18eba8fb0e9843d57241e404aea12bcba57ed037827f16d98ba6 0.0s => [internal] load build context 0.0s => => transferring context: 1.53kB 0.0s => CACHED [base 2/2] RUN mv /etc/apt/apt.conf.d/docker-clean /etc/apt/ && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf. 0.0s => CACHED [prepper 1/3] WORKDIR /opt/rgl 0.0s => CACHED [prepper 2/3] COPY package.xml src/RGLGazeboPlugin/package.xml 0.0s => CACHED [prepper 3/3] RUN --mount=type=cache,sharing=locked,target=/var/cache/apt rosdep install -y --from-paths src --ignore-src 0.0s => CACHED [builder 1/3] COPY . /tmp/RGLGazeboPlugin 0.0s => CACHED [builder 2/3] RUN --mount=type=cache,target=src/,rw cp -r /tmp/RGLGazeboPlugin src/RGLGazeboPlugin 0.0s => ERROR [builder 3/3] RUN --mount=type=cache,target=src/,ro . /opt/ros/jazzy/setup.sh && colcon build 4.6s ------ > [builder 3/3] RUN --mount=type=cache,target=src/,ro . /opt/ros/jazzy/setup.sh && colcon build: 0.882 WARNING: Package name "RGLGazeboPlugin" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes. 0.918 Starting >>> RGLGazeboPlugin 4.342 --- stderr: RGLGazeboPlugin 4.342 CMake Error at RGLServerPlugin/CMakeLists.txt:47 (file): 4.342 file DOWNLOAD cannot open file for write. 4.342 4.342 4.342 --- 4.342 Failed <<< RGLGazeboPlugin [3.42s, exited with code 1] 4.400 4.400 Summary: 0 packages finished [3.60s] 4.400 1 package failed: RGLGazeboPlugin 4.400 1 package had stderr output: RGLGazeboPlugin ------ Dockerfile:38 -------------------- 37 | 38 | >>> RUN --mount=type=cache,target=src/,ro \ 39 | >>> . /opt/ros/$ROS_DISTRO/setup.sh && \ 40 | >>> colcon build 41 | -------------------- ERROR: failed to solve: process "/bin/sh -c . /opt/ros/$ROS_DISTRO/setup.sh && colcon build" did not complete successfully: exit code: 1 ```

Note: reverting 3f69342 will not produce the expected built output, but avoids violating the expected CMake/colcon norms.

ruffsl commented 4 months ago

please change the base branch to main.

Done!