RobinWolf / diy_robotarm_wer24_description

0 stars 0 forks source link

Docker build script fails due to group ID conflict and pull access denied #1

Closed bibinthomas007 closed 2 months ago

bibinthomas007 commented 2 months ago

When running the run.sh script to build a Docker container, the build process fails with the following errors:

=> ERROR [base 3/7] RUN groupadd -g 0 hephaestus && useradd -m -u 0 -g 0 --shell $(which 0.3s


[base 3/7] RUN groupadd -g 0 hephaestus && useradd -m -u 0 -g 0 --shell $(which bash) hephaestus: 0.289 groupadd: GID '0' already exists

Dockerfile:16

15 | ENV USER=$USER 16 | >>> RUN groupadd -g $GID $USER \ 17 | >>> && useradd -m -u $UID -g $GID --shell $(which bash) $USER 18 |

ERROR: failed to solve: process "/bin/sh -c groupadd -g $GID $USER && useradd -m -u $UID -g $GID --shell $(which bash) $USER" did not complete successfully: exit code: 4 "docker run" requires at least 1 argument. See 'docker run --help'.

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Create and run a new container from an image Unable to find image 'automaton-dev/ros-render:humble' locally docker: Error response from daemon: pull access denied for automaton-dev/ros-render, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'.

Environment:

Operating System: Ubuntu 22.04.4 LTS Docker Version: Docker version 26.0.0, build 2ae903e

This issue should be addressed to resolve the Docker build failures and ensure a smooth build process for users.

RobinWolf commented 2 months ago

uid / gid should not be 0., because 0 is already reserved by the root user of your host machine. Custom users should start at uid / gid = 1000 to not interfere with the system ones (as configured in my Dockerfile)

try to clone the repos main branch to your filesystem again and run ./run.sh inside your directory. don't change anything in the files contend. You also need a established WIFI connection to get access to the ROS-Image for our base image from dockerhub.

bibinthomas007 commented 2 months ago

I have tried to clone the main repo again and run ./run.sh but still the same error.

On Sun, Apr 7, 2024 at 7:17 PM RobinWolf @.***> wrote:

uid / gid should not be 0., because 0 is already reserved by the root user of your host machine. Custom users should start at uid / gid = 1000 to not interfere with the system ones (as configured in my Dockerfile)

try to clone the repos main branch to your filesystem again and run ./run.sh inside your directory. don't change anything in the files contend. You also need a established WIFI connection to get access to the ROS-Image for our base image from dockerhub.

— Reply to this email directly, view it on GitHub https://github.com/RobinWolf/diy_robotarm_wer24_description/issues/1#issuecomment-2041477256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKIE63XW4ZHGTN5HSOL2L5DY4FFARAVCNFSM6AAAAABF3JI2DGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGQ3TOMRVGY . You are receiving this because you authored the thread.Message ID: @.***>

bibinthomas007 commented 2 months ago

The previous issue is solved when i reinstalled docker and tried it. Now i have a new issue. Create and run a new container from an image [INFO] [launch]: All log files can be found below /home/hephaestus/.ros/log/2024-04-11-13-59-42-717532-docker-desktop-1 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [59] [INFO] [joint_state_publisher_gui-2]: process started with pid [61] [INFO] [rviz2-3]: process started with pid [63] [robot_state_publisher-1] [INFO] [1712843983.073398396] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1712843983.073576870] [robot_state_publisher]: got segment link_1 [robot_state_publisher-1] [INFO] [1712843983.073585888] [robot_state_publisher]: got segment link_2 [robot_state_publisher-1] [INFO] [1712843983.073592560] [robot_state_publisher]: got segment link_3 [robot_state_publisher-1] [INFO] [1712843983.073598191] [robot_state_publisher]: got segment link_4 [robot_state_publisher-1] [INFO] [1712843983.073603893] [robot_state_publisher]: got segment link_5 [robot_state_publisher-1] [INFO] [1712843983.073609473] [robot_state_publisher]: got segment link_6 [robot_state_publisher-1] [INFO] [1712843983.073614934] [robot_state_publisher]: got segment world [rviz2-3] qt.qpa.xcb: could not connect to display :0 [rviz2-3] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. [rviz2-3] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. [rviz2-3] [rviz2-3] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb. [rviz2-3] [ERROR] [rviz2-3]: process has died [pid 63, exit code -6, cmd '/opt/ros/humble/lib/rviz2/rviz2 -d /home/hephaestus/dependencies/diy_robotarm_wer24_description_ws/install/diy_robotarm_wer24_description/share/diy_robotarm_wer24_description/rviz/rviz_config.rviz --ros-args -r __node:=rviz2']. [joint_state_publisher_gui-2] qt.qpa.xcb: could not connect to display :0 [joint_state_publisher_gui-2] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. [joint_state_publisher_gui-2] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. [joint_state_publisher_gui-2] [joint_state_publisher_gui-2] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb. [joint_state_publisher_gui-2] [ERROR] [joint_state_publisher_gui-2]: process has died [pid 61, exit code -6, cmd '/opt/ros/humble/lib/joint_state_publisher_gui/joint_state_publisher_gui --ros-args']. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)

[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 59]

should i close this issue and open a new issue on this

RobinWolf commented 2 months ago

The start of the RVIZ application fails because your display is not accessable from inside the Docker. One way to fix this issue is to look in your local Linux Root System which number your display variable is set to (Type echo $DISPLAY) into your Terminal. This Variable is passed to the Docker and this Display if used for graphical rendering by the docker container. In your case it forwards 0 to the docker (which is default and should work normally).

You can change the Display which gets connected to the docker container in the run.sh script by replacing $DISPLAY with a hardcoded number you get from echo $DISPLAY.

docker run \ --name robot_cell \ --rm \ -it \ --net=host \ -e DISPLAY="$DISPLAY" \ automaton-dev/ros-render:"$ROS_DISTRO"

I imagine you are using a Virtual Machine in which you are running the run.sh script? This isnt a good practice when working with Docker and ROS because all the enviromantal setup like the user and storage/ cpu management is a complete mess. I recommend to install Ubuntu directly as your operating system on the real host-machine or as Dual Boot if you are also using windows.