From 72bf6cc97a8ad091ee5ae4c61f7d40d1f1bae832 Mon Sep 17 00:00:00 2001 From: mhofma Date: Wed, 3 Oct 2018 14:12:24 +0200 Subject: [PATCH 1/3] ADD scripts for UR version 3.7.0.40195 --- .../3.7.0.40195/Dockerfile | 86 ++++ .../3.7.0.40195/README.md | 13 + .../3.7.0.40195/scripts/install_ursim.sh | 29 ++ .../3.7.0.40195/scripts/my_init | 420 ++++++++++++++++++ .../3.7.0.40195/scripts/setuser | 65 +++ 5 files changed, 613 insertions(+) create mode 100644 universal-robot-simulator/3.7.0.40195/Dockerfile create mode 100644 universal-robot-simulator/3.7.0.40195/README.md create mode 100644 universal-robot-simulator/3.7.0.40195/scripts/install_ursim.sh create mode 100644 universal-robot-simulator/3.7.0.40195/scripts/my_init create mode 100644 universal-robot-simulator/3.7.0.40195/scripts/setuser diff --git a/universal-robot-simulator/3.7.0.40195/Dockerfile b/universal-robot-simulator/3.7.0.40195/Dockerfile new file mode 100644 index 0000000..a716dad --- /dev/null +++ b/universal-robot-simulator/3.7.0.40195/Dockerfile @@ -0,0 +1,86 @@ +FROM jacknlliu/ubuntu-init:14.04 + +LABEL maintainer="Jack Liu " + +# setup environment +ENV DEBIAN_FRONTEND noninteractive + +# setup locale +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 + +# install system packages +RUN apt-get update -y \ + && apt-get install -y -q --no-install-recommends apt-transport-https aptitude + +# install essential tools +RUN aptitude install -y -q -R bash-completion wget vim git tmux terminator xauth openssh-server runit sudo software-properties-common python-software-properties debconf-utils policykit-1 xterm \ + \ + lib32stdc++6 lib32gcc1 libjava3d-java libcurl3:i386\ +# setup ssh + && mkdir -p /var/run/sshd && echo "X11UseLocalhost no" >> /etc/ssh/sshd_config \ + \ +# install URSim prerequisite + && dpkg --add-architecture i386 && aptitude update -y \ + && aptitude install -y -q -R openjdk-8-jre openjdk-8-jdk libxmlrpc-c++8:i386 \ + && echo "JAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java\"" >> /etc/environment + +#RUN apt-get update && apt-get -y upgrade && apt-get -y install software-properties-common && add-apt-repository ppa:webupd8team/java -y && apt-get update +#RUN (echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections) && apt-get install -y oracle-java8-installer oracle-java8-set-default +#ENV JAVA_HOME /usr/lib/jvm/java-8-oracle + + +#ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java +#ENV PATH $JAVA_HOME/bin:$PATH + +# set default java environment variable +ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 +RUN add-apt-repository ppa:openjdk-r/ppa -y && \ + apt-get update && \ + apt-get install -y --no-install-recommends openjdk-8-jdk && \ + rm -rf /var/lib/apt/lists/* + +# install intel graphics driver +RUN aptitude install -y -q -R libgl1-mesa-glx libgl1-mesa-dri \ + \ +# install amd graphics open source driver + && aptitude install -y -q -R mesa-vdpau-drivers xserver-xorg-video-ati mesa-utils module-init-tools + +# we should fix AMD graphics driver with image driver extension not found in ubuntu 14.04.2, refrence: https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Ubuntu_14.04_LTS_-_Trusty_Tahr +# && aptitude install -y -q -R linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial + +# set user ros and sudo +RUN adduser --gecos "URSim User" --home /home/ursim --disabled-password ursim \ + && usermod -a -G dialout ursim \ + && echo "ursim ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_aptget \ + && mkdir -p /opt/ursim + +# install ursim +COPY scripts/install_ursim.sh /opt/ursim/ +RUN chmod -R a+rx /opt/ursim && sync && /opt/ursim/install_ursim.sh "/opt/ursim/" "ursim" && rm -f /opt/ursim/install_ursim.sh && chmod -R a+rwx /opt/ursim + +COPY scripts/my_init /sbin/my_init +COPY scripts/setuser /sbin/setuser +RUN chmod +x /sbin/my_init && chmod +x /sbin/setuser + +# aptitude clean +RUN apt-get autoclean \ + && apt-get clean all \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* /var/tmp/* + +ENV PATH /opt/ursim/ursimpkg:$PATH +ENV URSIM_ROOT /opt/ursim/ursimpkg + +# redefine env for my_init +RUN mkdir -p /etc/container_environment \ + && echo "JAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java\"" >> /etc/container_environment/JAVA_HOME \ + && echo "PATH=\"/opt/ursim/ursimpkg:$PATH\"" >> /etc/container_environment/PATH \ + && echo "URSIM_ROOT=\"/opt/ursim/ursimpkg\"" >> /etc/container_environment/URSIM_ROOT + +USER root +WORKDIR /opt/ursim/ursimpkg +# /sbin/my_init should be launched by root user +##ENTRYPOINT ["/sbin/my_init", "--quiet", "--", "setuser", "ursim"] +CMD ["bash"] diff --git a/universal-robot-simulator/3.7.0.40195/README.md b/universal-robot-simulator/3.7.0.40195/README.md new file mode 100644 index 0000000..d57e71e --- /dev/null +++ b/universal-robot-simulator/3.7.0.40195/README.md @@ -0,0 +1,13 @@ +# Universal Robot Simulator + +**NOTE:** This image just for research. All rights of the offline simulator applications belong to [Universal Robots A/S](https://www.universal-robots.com). + + +## Usage +``` +docker run -it --security-opt label=disable \ + --device /dev/dri --env="DISPLAY" \ + --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ + -p 30001-30004:30001-30004 \ + --name="ursim" jacknlliu/ursim:3.4.1-59 start-ursim.sh UR5 +``` diff --git a/universal-robot-simulator/3.7.0.40195/scripts/install_ursim.sh b/universal-robot-simulator/3.7.0.40195/scripts/install_ursim.sh new file mode 100644 index 0000000..36bb4ee --- /dev/null +++ b/universal-robot-simulator/3.7.0.40195/scripts/install_ursim.sh @@ -0,0 +1,29 @@ +#! /bin/bash +set -e \ + && export UR_DOWNLOAD_SITE="https://s3-eu-west-1.amazonaws.com/ur-support-site/44059/URSim_Linux-3.7.0.40195.tar.gz" \ + && export URSIMVERSION="3.7.0.40195" \ + && export INSTALL_DIR=$1 \ + && export URSIM_USER=$2 \ + && echo "INSTALL_DIR: $INSTALL_DIR \n URSIM_USER: $URSIM_USER" \ + \ + && echo "install ursim" > /dev/null \ + && cd $INSTALL_DIR && wget -q -O ursim.tar.gz ${UR_DOWNLOAD_SITE} && tar -xvzf ursim.tar.gz && mv ursim-${URSIMVERSION} ursimpkg && cd ursimpkg \ + \ + && echo "delete 56 lines for not installing java7" > /dev/null \ + && sed -i '56c \\t echo \"just ignore install java7\" ' ./install.sh \ + && echo "delete 49-50 lines for no xterm exit" > /dev/null \ + && sed -i '49,50c \\t echo \"just ignore xterm warning\" ' ./install.sh \ + && sed -i 's/pkexec bash -c/bash -c/g' ./install.sh \ + && sed -i 's/apt-get -y install/apt-get -y install -q --no-install-recommends/g' ./install.sh \ + && sed -i '85,$d' ./install.sh \ + && sed -i 's/libcurl3/libcurl3:i386/g' ./install.sh \ + && sed -i 's/fonts-ipafont//g' ./install.sh \ + && sed -i 's/fonts-baekmuk//g' ./install.sh \ + && sed -i 's/fonts-nanum//g' ./install.sh \ + && sed -i 's/fonts-arphic-uming//g' ./install.sh \ + && sed -i 's/fonts-arphic-ukai//g' ./install.sh \ + && echo "echo \" installation done! \"" >> ./install.sh \ + && ./install.sh \ + && cd .. && rm -f ./ursim.tar.gz \ + && chown -R $URSIM_USER:$URSIM_USER ursimpkg \ + && chmod a+rx ursimpkg/URControl diff --git a/universal-robot-simulator/3.7.0.40195/scripts/my_init b/universal-robot-simulator/3.7.0.40195/scripts/my_init new file mode 100644 index 0000000..a6ded83 --- /dev/null +++ b/universal-robot-simulator/3.7.0.40195/scripts/my_init @@ -0,0 +1,420 @@ +#!/usr/bin/python3 -u +# -*- coding: utf-8 -*- + +import argparse +import errno +import json +import os +import os.path +import re +import signal +import stat +import sys +import time + +KILL_PROCESS_TIMEOUT = int(os.environ.get('KILL_PROCESS_TIMEOUT', 5)) +KILL_ALL_PROCESSES_TIMEOUT = int(os.environ.get('KILL_ALL_PROCESSES_TIMEOUT', 5)) + +LOG_LEVEL_ERROR = 1 +LOG_LEVEL_WARN = 1 +LOG_LEVEL_INFO = 2 +LOG_LEVEL_DEBUG = 3 + +SHENV_NAME_WHITELIST_REGEX = re.compile('[^\w\-_\.]') + +log_level = None + +terminated_child_processes = {} + +_find_unsafe = re.compile(r'[^\w@%+=:,./-]').search + + +class AlarmException(Exception): + pass + + +def error(message): + if log_level >= LOG_LEVEL_ERROR: + sys.stderr.write("*** %s\n" % message) + + +def warn(message): + if log_level >= LOG_LEVEL_WARN: + sys.stderr.write("*** %s\n" % message) + + +def info(message): + if log_level >= LOG_LEVEL_INFO: + sys.stderr.write("*** %s\n" % message) + + +def debug(message): + if log_level >= LOG_LEVEL_DEBUG: + sys.stderr.write("*** %s\n" % message) + + +def ignore_signals_and_raise_keyboard_interrupt(signame): + signal.signal(signal.SIGTERM, signal.SIG_IGN) + signal.signal(signal.SIGINT, signal.SIG_IGN) + raise KeyboardInterrupt(signame) + + +def raise_alarm_exception(): + raise AlarmException('Alarm') + + +def listdir(path): + try: + result = os.stat(path) + except OSError: + return [] + if stat.S_ISDIR(result.st_mode): + return sorted(os.listdir(path)) + else: + return [] + + +def is_exe(path): + try: + return os.path.isfile(path) and os.access(path, os.X_OK) + except OSError: + return False + + +def import_envvars(clear_existing_environment=True, override_existing_environment=True): + if not os.path.exists("/etc/container_environment"): + return + new_env = {} + for envfile in listdir("/etc/container_environment"): + name = os.path.basename(envfile) + with open("/etc/container_environment/" + envfile, "r") as f: + # Text files often end with a trailing newline, which we + # don't want to include in the env variable value. See + # https://github.com/phusion/baseimage-docker/pull/49 + value = re.sub('\n\Z', '', f.read()) + new_env[name] = value + if clear_existing_environment: + os.environ.clear() + for name, value in new_env.items(): + if override_existing_environment or name not in os.environ: + os.environ[name] = value + + +def export_envvars(to_dir=True): + if not os.path.exists("/etc/container_environment"): + return + shell_dump = "" + for name, value in os.environ.items(): + if name in ['HOME', 'USER', 'GROUP', 'UID', 'GID', 'SHELL']: + continue + if to_dir: + with open("/etc/container_environment/" + name, "w") as f: + f.write(value) + shell_dump += "export " + sanitize_shenvname(name) + "=" + shquote(value) + "\n" + with open("/etc/container_environment.sh", "w") as f: + f.write(shell_dump) + with open("/etc/container_environment.json", "w") as f: + f.write(json.dumps(dict(os.environ))) + + +def shquote(s): + """Return a shell-escaped version of the string *s*.""" + if not s: + return "''" + if _find_unsafe(s) is None: + return s + + # use single quotes, and put single quotes into double quotes + # the string $'b is then quoted as '$'"'"'b' + return "'" + s.replace("'", "'\"'\"'") + "'" + + +def sanitize_shenvname(s): + return re.sub(SHENV_NAME_WHITELIST_REGEX, "_", s) + + +# Waits for the child process with the given PID, while at the same time +# reaping any other child processes that have exited (e.g. adopted child +# processes that have terminated). + +def waitpid_reap_other_children(pid): + global terminated_child_processes + + status = terminated_child_processes.get(pid) + if status: + # A previous call to waitpid_reap_other_children(), + # with an argument not equal to the current argument, + # already waited for this process. Return the status + # that was obtained back then. + del terminated_child_processes[pid] + return status + + done = False + status = None + while not done: + try: + # https://github.com/phusion/baseimage-docker/issues/151#issuecomment-92660569 + this_pid, status = os.waitpid(pid, os.WNOHANG) + if this_pid == 0: + this_pid, status = os.waitpid(-1, 0) + if this_pid == pid: + done = True + else: + # Save status for later. + terminated_child_processes[this_pid] = status + except OSError as e: + if e.errno == errno.ECHILD or e.errno == errno.ESRCH: + return None + else: + raise + return status + + +def stop_child_process(name, pid, signo=signal.SIGTERM, time_limit=KILL_PROCESS_TIMEOUT): + info("Shutting down %s (PID %d)..." % (name, pid)) + try: + os.kill(pid, signo) + except OSError: + pass + signal.alarm(time_limit) + try: + try: + waitpid_reap_other_children(pid) + except OSError: + pass + except AlarmException: + warn("%s (PID %d) did not shut down in time. Forcing it to exit." % (name, pid)) + try: + os.kill(pid, signal.SIGKILL) + except OSError: + pass + try: + waitpid_reap_other_children(pid) + except OSError: + pass + finally: + signal.alarm(0) + + +def run_command_killable(*argv): + filename = argv[0] + status = None + pid = os.spawnvp(os.P_NOWAIT, filename, argv) + try: + status = waitpid_reap_other_children(pid) + except BaseException: + warn("An error occurred. Aborting.") + stop_child_process(filename, pid) + raise + if status != 0: + if status is None: + error("%s exited with unknown status\n" % filename) + else: + error("%s failed with status %d\n" % (filename, os.WEXITSTATUS(status))) + sys.exit(1) + + +def run_command_killable_and_import_envvars(*argv): + run_command_killable(*argv) + import_envvars() + export_envvars(False) + + +def kill_all_processes(time_limit): + info("Killing all processes...") + try: + os.kill(-1, signal.SIGTERM) + except OSError: + pass + signal.alarm(time_limit) + try: + # Wait until no more child processes exist. + done = False + while not done: + try: + os.waitpid(-1, 0) + except OSError as e: + if e.errno == errno.ECHILD: + done = True + else: + raise + except AlarmException: + warn("Not all processes have exited in time. Forcing them to exit.") + try: + os.kill(-1, signal.SIGKILL) + except OSError: + pass + finally: + signal.alarm(0) + + +def run_startup_files(): + # Run /etc/my_init.d/* + for name in listdir("/etc/my_init.d"): + filename = "/etc/my_init.d/" + name + if is_exe(filename): + info("Running %s..." % filename) + run_command_killable_and_import_envvars(filename) + + # Run /etc/rc.local. + if is_exe("/etc/rc.local"): + info("Running /etc/rc.local...") + run_command_killable_and_import_envvars("/etc/rc.local") + + +def run_pre_shutdown_scripts(): + debug("Running pre-shutdown scripts...") + + # Run /etc/my_init.pre_shutdown.d/* + for name in listdir("/etc/my_init.pre_shutdown.d"): + filename = "/etc/my_init.pre_shutdown.d/" + name + if is_exe(filename): + info("Running %s..." % filename) + run_command_killable(filename) + + +def run_post_shutdown_scripts(): + debug("Running post-shutdown scripts...") + + # Run /etc/my_init.post_shutdown.d/* + for name in listdir("/etc/my_init.post_shutdown.d"): + filename = "/etc/my_init.post_shutdown.d/" + name + if is_exe(filename): + info("Running %s..." % filename) + run_command_killable(filename) + + +def start_runit(): + info("Booting runit daemon...") + pid = os.spawnl(os.P_NOWAIT, "/usr/bin/runsvdir", "/usr/bin/runsvdir", + "-P", "/etc/service") + info("Runit started as PID %d" % pid) + return pid + + +def wait_for_runit_or_interrupt(pid): + try: + status = waitpid_reap_other_children(pid) + return (True, status) + except KeyboardInterrupt: + return (False, None) + + +def shutdown_runit_services(quiet=False): + if not quiet: + debug("Begin shutting down runit services...") + os.system("/usr/bin/sv -w %d down /etc/service/* > /dev/null" % KILL_PROCESS_TIMEOUT) + + +def wait_for_runit_services(): + debug("Waiting for runit services to exit...") + done = False + while not done: + done = os.system("/usr/bin/sv status /etc/service/* | grep -q '^run:'") != 0 + if not done: + time.sleep(0.1) + # According to https://github.com/phusion/baseimage-docker/issues/315 + # there is a bug or race condition in Runit, causing it + # not to shutdown services that are already being started. + # So during shutdown we repeatedly instruct Runit to shutdown + # services. + shutdown_runit_services(True) + + +def install_insecure_key(): + info("Installing insecure SSH key for user root") + run_command_killable("/usr/sbin/enable_insecure_key") + + +def main(args): + import_envvars(False, False) + export_envvars() + + if args.enable_insecure_key: + install_insecure_key() + + if not args.skip_startup_files: + run_startup_files() + + runit_exited = False + exit_code = None + + if not args.skip_runit: + runit_pid = start_runit() + try: + exit_status = None + if len(args.main_command) == 0: + runit_exited, exit_code = wait_for_runit_or_interrupt(runit_pid) + if runit_exited: + if exit_code is None: + info("Runit exited with unknown status") + exit_status = 1 + else: + exit_status = os.WEXITSTATUS(exit_code) + info("Runit exited with status %d" % exit_status) + else: + info("Running %s..." % " ".join(args.main_command)) + pid = os.spawnvp(os.P_NOWAIT, args.main_command[0], args.main_command) + try: + exit_code = waitpid_reap_other_children(pid) + if exit_code is None: + info("%s exited with unknown status." % args.main_command[0]) + exit_status = 1 + else: + exit_status = os.WEXITSTATUS(exit_code) + info("%s exited with status %d." % (args.main_command[0], exit_status)) + except KeyboardInterrupt: + stop_child_process(args.main_command[0], pid) + raise + except BaseException: + warn("An error occurred. Aborting.") + stop_child_process(args.main_command[0], pid) + raise + sys.exit(exit_status) + finally: + if not args.skip_runit: + run_pre_shutdown_scripts() + shutdown_runit_services() + if not runit_exited: + stop_child_process("runit daemon", runit_pid) + wait_for_runit_services() + run_post_shutdown_scripts() + +# Parse options. +parser = argparse.ArgumentParser(description='Initialize the system.') +parser.add_argument('main_command', metavar='MAIN_COMMAND', type=str, nargs='*', + help='The main command to run. (default: runit)') +parser.add_argument('--enable-insecure-key', dest='enable_insecure_key', + action='store_const', const=True, default=False, + help='Install the insecure SSH key') +parser.add_argument('--skip-startup-files', dest='skip_startup_files', + action='store_const', const=True, default=False, + help='Skip running /etc/my_init.d/* and /etc/rc.local') +parser.add_argument('--skip-runit', dest='skip_runit', + action='store_const', const=True, default=False, + help='Do not run runit services') +parser.add_argument('--no-kill-all-on-exit', dest='kill_all_on_exit', + action='store_const', const=False, default=True, + help='Don\'t kill all processes on the system upon exiting') +parser.add_argument('--quiet', dest='log_level', + action='store_const', const=LOG_LEVEL_WARN, default=LOG_LEVEL_INFO, + help='Only print warnings and errors') +args = parser.parse_args() +log_level = args.log_level + +if args.skip_runit and len(args.main_command) == 0: + error("When --skip-runit is given, you must also pass a main command.") + sys.exit(1) + +# Run main function. +signal.signal(signal.SIGTERM, lambda signum, frame: ignore_signals_and_raise_keyboard_interrupt('SIGTERM')) +signal.signal(signal.SIGINT, lambda signum, frame: ignore_signals_and_raise_keyboard_interrupt('SIGINT')) +signal.signal(signal.SIGALRM, lambda signum, frame: raise_alarm_exception()) +try: + main(args) +except KeyboardInterrupt: + warn("Init system aborted.") + exit(2) +finally: + if args.kill_all_on_exit: + kill_all_processes(KILL_ALL_PROCESSES_TIMEOUT) diff --git a/universal-robot-simulator/3.7.0.40195/scripts/setuser b/universal-robot-simulator/3.7.0.40195/scripts/setuser new file mode 100644 index 0000000..df660bf --- /dev/null +++ b/universal-robot-simulator/3.7.0.40195/scripts/setuser @@ -0,0 +1,65 @@ +#!/usr/bin/python3 + +''' +Copyright (c) 2013-2015 Phusion Holding B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' + +import sys +import os +import pwd + + +def abort(message): + sys.stderr.write("setuser: %s\n" % message) + sys.exit(1) + + +def main(): + ''' + A simple alternative to sudo that executes a command as a user by setting + the user ID and user parameters to those described by the system and then + using execvp(3) to execute the command without the necessity of a TTY + ''' + + username = sys.argv[1] + try: + user = pwd.getpwnam(username) + except KeyError: + abort("user %s not found" % username) + os.initgroups(username, user.pw_gid) + os.setgid(user.pw_gid) + os.setuid(user.pw_uid) + os.environ['USER'] = username + os.environ['HOME'] = user.pw_dir + os.environ['UID'] = str(user.pw_uid) + try: + os.execvp(sys.argv[2], sys.argv[2:]) + except OSError as e: + abort("cannot execute %s: %s" % (sys.argv[2], str(e))) + +if __name__ == '__main__': + + if len(sys.argv) < 3: + sys.stderr.write("Usage: /sbin/setuser USERNAME COMMAND [args..]\n") + sys.exit(1) + + main() + From 75bd61892f16dcd93d8eca615e1f7a94bfa0f85e Mon Sep 17 00:00:00 2001 From: mhofma Date: Tue, 23 Apr 2019 09:29:29 +0200 Subject: [PATCH 2/3] add ursim version 5.3 --- .../5.3.1.64192/Dockerfile | 86 ++++ .../5.3.1.64192/README.md | 12 + .../5.3.1.64192/scripts/install_ursim.sh | 29 ++ .../5.3.1.64192/scripts/my_init | 420 ++++++++++++++++++ .../5.3.1.64192/scripts/setuser | 65 +++ 5 files changed, 612 insertions(+) create mode 100644 universal-robot-simulator/5.3.1.64192/Dockerfile create mode 100644 universal-robot-simulator/5.3.1.64192/README.md create mode 100644 universal-robot-simulator/5.3.1.64192/scripts/install_ursim.sh create mode 100644 universal-robot-simulator/5.3.1.64192/scripts/my_init create mode 100644 universal-robot-simulator/5.3.1.64192/scripts/setuser diff --git a/universal-robot-simulator/5.3.1.64192/Dockerfile b/universal-robot-simulator/5.3.1.64192/Dockerfile new file mode 100644 index 0000000..9ed1fc0 --- /dev/null +++ b/universal-robot-simulator/5.3.1.64192/Dockerfile @@ -0,0 +1,86 @@ +FROM jacknlliu/ubuntu-init:14.04 + +LABEL maintainer="Jack Liu " + +# setup environment +ENV DEBIAN_FRONTEND noninteractive + +# setup locale +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 + +# install system packages +RUN apt-get update -y \ + && apt-get install -y -q --no-install-recommends apt-transport-https aptitude + +# install essential tools +RUN aptitude install -y -q -R bash-completion wget vim git tmux terminator xauth openssh-server runit sudo software-properties-common python-software-properties debconf-utils policykit-1 xterm \ + \ + lib32stdc++6 lib32gcc1 libjava3d-java libcurl3:i386\ +# setup ssh + && mkdir -p /var/run/sshd && echo "X11UseLocalhost no" >> /etc/ssh/sshd_config \ + \ +# install URSim prerequisite + && dpkg --add-architecture i386 && aptitude update -y \ + && aptitude install -y -q -R openjdk-8-jre openjdk-8-jdk libxmlrpc-c++8:i386 \ + && echo "JAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java\"" >> /etc/environment + +#RUN apt-get update && apt-get -y upgrade && apt-get -y install software-properties-common && add-apt-repository ppa:webupd8team/java -y && apt-get update +#RUN (echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections) && apt-get install -y oracle-java8-installer oracle-java8-set-default +#ENV JAVA_HOME /usr/lib/jvm/java-8-oracle + + +#ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java +#ENV PATH $JAVA_HOME/bin:$PATH + +# set default java environment variable +ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 +RUN add-apt-repository ppa:openjdk-r/ppa -y && \ + apt-get update && \ + apt-get install -y --no-install-recommends openjdk-8-jdk && \ + rm -rf /var/lib/apt/lists/* + +# install intel graphics driver +RUN aptitude install -y -q -R libgl1-mesa-glx libgl1-mesa-dri \ + \ +# install amd graphics open source driver + && aptitude install -y -q -R mesa-vdpau-drivers xserver-xorg-video-ati mesa-utils module-init-tools + +# we should fix AMD graphics driver with image driver extension not found in ubuntu 14.04.2, refrence: https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Ubuntu_14.04_LTS_-_Trusty_Tahr +# && aptitude install -y -q -R linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial + +# set user ros and sudo +RUN adduser --gecos "URSim User" --home /home/ursim --disabled-password ursim \ + && usermod -a -G dialout ursim \ + && echo "ursim ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_aptget \ + && mkdir -p /opt/ursim + +# install ursim +COPY scripts/install_ursim.sh /opt/ursim/ +RUN chmod -R a+rx /opt/ursim && sync && /opt/ursim/install_ursim.sh "/opt/ursim/" "ursim" && rm -f /opt/ursim/install_ursim.sh && chmod -R a+rwx /opt/ursim + +COPY scripts/my_init /sbin/my_init +COPY scripts/setuser /sbin/setuser +RUN chmod +x /sbin/my_init && chmod +x /sbin/setuser + +# aptitude clean +RUN apt-get autoclean \ + && apt-get clean all \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* /var/tmp/* + +ENV PATH /opt/ursim/ursimpkg:$PATH +ENV URSIM_ROOT /opt/ursim/ursimpkg + +# redefine env for my_init +RUN mkdir -p /etc/container_environment \ + && echo "JAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java\"" >> /etc/container_environment/JAVA_HOME \ + && echo "PATH=\"/opt/ursim/ursimpkg:$PATH\"" >> /etc/container_environment/PATH \ + && echo "URSIM_ROOT=\"/opt/ursim/ursimpkg\"" >> /etc/container_environment/URSIM_ROOT + +USER root +WORKDIR /opt/ursim/ursimpkg +# /sbin/my_init should be launched by root user +##ENTRYPOINT ["/sbin/my_init", "--quiet", "--", "setuser", "ursim"] +CMD ["bash"] diff --git a/universal-robot-simulator/5.3.1.64192/README.md b/universal-robot-simulator/5.3.1.64192/README.md new file mode 100644 index 0000000..1091d19 --- /dev/null +++ b/universal-robot-simulator/5.3.1.64192/README.md @@ -0,0 +1,12 @@ +# Universal Robot Simulator + +**NOTE:** This image just for research. All rights of the offline simulator applications belong to [Universal Robots A/S](https://www.universal-robots.com). + + +## Usage +``` +docker run -it --security-opt label=disable --device /dev/dri --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" -p 30001-30004:30001-30004 --name="ursim" jacknlliu/ursim:5.3.1.64192 start-ursim.sh UR10 +``` + +docker build . -t ursim:5.3.1.64192 +docker run -it --rm --security-opt label=disable -e DISPLAY=192.168.20.125:0.0 --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --privileged -p 29999-30004:29999-30004 -p 502:502 --name="ursim" ursim:5.3.1.64192 start-ursim.sh UR10 diff --git a/universal-robot-simulator/5.3.1.64192/scripts/install_ursim.sh b/universal-robot-simulator/5.3.1.64192/scripts/install_ursim.sh new file mode 100644 index 0000000..6a8fe7f --- /dev/null +++ b/universal-robot-simulator/5.3.1.64192/scripts/install_ursim.sh @@ -0,0 +1,29 @@ +#! /bin/bash +set -e \ + && export UR_DOWNLOAD_SITE="https://s3-eu-west-1.amazonaws.com/ur-support-site/51847/URSim_Linux-5.3.1.64192.tar.gz" \ + && export URSIMVERSION="5.3.1.64192" \ + && export INSTALL_DIR=$1 \ + && export URSIM_USER=$2 \ + && echo "INSTALL_DIR: $INSTALL_DIR \n URSIM_USER: $URSIM_USER" \ + \ + && echo "install ursim" > /dev/null \ + && cd $INSTALL_DIR && wget -q -O ursim.tar.gz ${UR_DOWNLOAD_SITE} && tar -xvzf ursim.tar.gz && mv ursim-${URSIMVERSION} ursimpkg && cd ursimpkg \ + \ + && echo "delete 57 lines for not installing java7" > /dev/null \ + && sed -i '57c \\t echo \"just ignore install java7\" ' ./install.sh \ + && echo "delete 50-51 lines for no xterm exit" > /dev/null \ + && sed -i '50,51c \\t echo \"just ignore xterm warning\" ' ./install.sh \ + && sed -i 's/pkexec bash -c/bash -c/g' ./install.sh \ + && sed -i 's/apt-get -y install/apt-get -y install -q --no-install-recommends/g' ./install.sh \ + && sed -i '86,$d' ./install.sh \ + && sed -i 's/libcurl3/libcurl3:i386/g' ./install.sh \ + && sed -i 's/fonts-ipafont//g' ./install.sh \ + && sed -i 's/fonts-baekmuk//g' ./install.sh \ + && sed -i 's/fonts-nanum//g' ./install.sh \ + && sed -i 's/fonts-arphic-uming//g' ./install.sh \ + && sed -i 's/fonts-arphic-ukai//g' ./install.sh \ + && echo "echo \" installation done! \"" >> ./install.sh \ + && ./install.sh \ + && cd .. && rm -f ./ursim.tar.gz \ + && chown -R $URSIM_USER:$URSIM_USER ursimpkg \ + && chmod a+rx ursimpkg/URControl diff --git a/universal-robot-simulator/5.3.1.64192/scripts/my_init b/universal-robot-simulator/5.3.1.64192/scripts/my_init new file mode 100644 index 0000000..a6ded83 --- /dev/null +++ b/universal-robot-simulator/5.3.1.64192/scripts/my_init @@ -0,0 +1,420 @@ +#!/usr/bin/python3 -u +# -*- coding: utf-8 -*- + +import argparse +import errno +import json +import os +import os.path +import re +import signal +import stat +import sys +import time + +KILL_PROCESS_TIMEOUT = int(os.environ.get('KILL_PROCESS_TIMEOUT', 5)) +KILL_ALL_PROCESSES_TIMEOUT = int(os.environ.get('KILL_ALL_PROCESSES_TIMEOUT', 5)) + +LOG_LEVEL_ERROR = 1 +LOG_LEVEL_WARN = 1 +LOG_LEVEL_INFO = 2 +LOG_LEVEL_DEBUG = 3 + +SHENV_NAME_WHITELIST_REGEX = re.compile('[^\w\-_\.]') + +log_level = None + +terminated_child_processes = {} + +_find_unsafe = re.compile(r'[^\w@%+=:,./-]').search + + +class AlarmException(Exception): + pass + + +def error(message): + if log_level >= LOG_LEVEL_ERROR: + sys.stderr.write("*** %s\n" % message) + + +def warn(message): + if log_level >= LOG_LEVEL_WARN: + sys.stderr.write("*** %s\n" % message) + + +def info(message): + if log_level >= LOG_LEVEL_INFO: + sys.stderr.write("*** %s\n" % message) + + +def debug(message): + if log_level >= LOG_LEVEL_DEBUG: + sys.stderr.write("*** %s\n" % message) + + +def ignore_signals_and_raise_keyboard_interrupt(signame): + signal.signal(signal.SIGTERM, signal.SIG_IGN) + signal.signal(signal.SIGINT, signal.SIG_IGN) + raise KeyboardInterrupt(signame) + + +def raise_alarm_exception(): + raise AlarmException('Alarm') + + +def listdir(path): + try: + result = os.stat(path) + except OSError: + return [] + if stat.S_ISDIR(result.st_mode): + return sorted(os.listdir(path)) + else: + return [] + + +def is_exe(path): + try: + return os.path.isfile(path) and os.access(path, os.X_OK) + except OSError: + return False + + +def import_envvars(clear_existing_environment=True, override_existing_environment=True): + if not os.path.exists("/etc/container_environment"): + return + new_env = {} + for envfile in listdir("/etc/container_environment"): + name = os.path.basename(envfile) + with open("/etc/container_environment/" + envfile, "r") as f: + # Text files often end with a trailing newline, which we + # don't want to include in the env variable value. See + # https://github.com/phusion/baseimage-docker/pull/49 + value = re.sub('\n\Z', '', f.read()) + new_env[name] = value + if clear_existing_environment: + os.environ.clear() + for name, value in new_env.items(): + if override_existing_environment or name not in os.environ: + os.environ[name] = value + + +def export_envvars(to_dir=True): + if not os.path.exists("/etc/container_environment"): + return + shell_dump = "" + for name, value in os.environ.items(): + if name in ['HOME', 'USER', 'GROUP', 'UID', 'GID', 'SHELL']: + continue + if to_dir: + with open("/etc/container_environment/" + name, "w") as f: + f.write(value) + shell_dump += "export " + sanitize_shenvname(name) + "=" + shquote(value) + "\n" + with open("/etc/container_environment.sh", "w") as f: + f.write(shell_dump) + with open("/etc/container_environment.json", "w") as f: + f.write(json.dumps(dict(os.environ))) + + +def shquote(s): + """Return a shell-escaped version of the string *s*.""" + if not s: + return "''" + if _find_unsafe(s) is None: + return s + + # use single quotes, and put single quotes into double quotes + # the string $'b is then quoted as '$'"'"'b' + return "'" + s.replace("'", "'\"'\"'") + "'" + + +def sanitize_shenvname(s): + return re.sub(SHENV_NAME_WHITELIST_REGEX, "_", s) + + +# Waits for the child process with the given PID, while at the same time +# reaping any other child processes that have exited (e.g. adopted child +# processes that have terminated). + +def waitpid_reap_other_children(pid): + global terminated_child_processes + + status = terminated_child_processes.get(pid) + if status: + # A previous call to waitpid_reap_other_children(), + # with an argument not equal to the current argument, + # already waited for this process. Return the status + # that was obtained back then. + del terminated_child_processes[pid] + return status + + done = False + status = None + while not done: + try: + # https://github.com/phusion/baseimage-docker/issues/151#issuecomment-92660569 + this_pid, status = os.waitpid(pid, os.WNOHANG) + if this_pid == 0: + this_pid, status = os.waitpid(-1, 0) + if this_pid == pid: + done = True + else: + # Save status for later. + terminated_child_processes[this_pid] = status + except OSError as e: + if e.errno == errno.ECHILD or e.errno == errno.ESRCH: + return None + else: + raise + return status + + +def stop_child_process(name, pid, signo=signal.SIGTERM, time_limit=KILL_PROCESS_TIMEOUT): + info("Shutting down %s (PID %d)..." % (name, pid)) + try: + os.kill(pid, signo) + except OSError: + pass + signal.alarm(time_limit) + try: + try: + waitpid_reap_other_children(pid) + except OSError: + pass + except AlarmException: + warn("%s (PID %d) did not shut down in time. Forcing it to exit." % (name, pid)) + try: + os.kill(pid, signal.SIGKILL) + except OSError: + pass + try: + waitpid_reap_other_children(pid) + except OSError: + pass + finally: + signal.alarm(0) + + +def run_command_killable(*argv): + filename = argv[0] + status = None + pid = os.spawnvp(os.P_NOWAIT, filename, argv) + try: + status = waitpid_reap_other_children(pid) + except BaseException: + warn("An error occurred. Aborting.") + stop_child_process(filename, pid) + raise + if status != 0: + if status is None: + error("%s exited with unknown status\n" % filename) + else: + error("%s failed with status %d\n" % (filename, os.WEXITSTATUS(status))) + sys.exit(1) + + +def run_command_killable_and_import_envvars(*argv): + run_command_killable(*argv) + import_envvars() + export_envvars(False) + + +def kill_all_processes(time_limit): + info("Killing all processes...") + try: + os.kill(-1, signal.SIGTERM) + except OSError: + pass + signal.alarm(time_limit) + try: + # Wait until no more child processes exist. + done = False + while not done: + try: + os.waitpid(-1, 0) + except OSError as e: + if e.errno == errno.ECHILD: + done = True + else: + raise + except AlarmException: + warn("Not all processes have exited in time. Forcing them to exit.") + try: + os.kill(-1, signal.SIGKILL) + except OSError: + pass + finally: + signal.alarm(0) + + +def run_startup_files(): + # Run /etc/my_init.d/* + for name in listdir("/etc/my_init.d"): + filename = "/etc/my_init.d/" + name + if is_exe(filename): + info("Running %s..." % filename) + run_command_killable_and_import_envvars(filename) + + # Run /etc/rc.local. + if is_exe("/etc/rc.local"): + info("Running /etc/rc.local...") + run_command_killable_and_import_envvars("/etc/rc.local") + + +def run_pre_shutdown_scripts(): + debug("Running pre-shutdown scripts...") + + # Run /etc/my_init.pre_shutdown.d/* + for name in listdir("/etc/my_init.pre_shutdown.d"): + filename = "/etc/my_init.pre_shutdown.d/" + name + if is_exe(filename): + info("Running %s..." % filename) + run_command_killable(filename) + + +def run_post_shutdown_scripts(): + debug("Running post-shutdown scripts...") + + # Run /etc/my_init.post_shutdown.d/* + for name in listdir("/etc/my_init.post_shutdown.d"): + filename = "/etc/my_init.post_shutdown.d/" + name + if is_exe(filename): + info("Running %s..." % filename) + run_command_killable(filename) + + +def start_runit(): + info("Booting runit daemon...") + pid = os.spawnl(os.P_NOWAIT, "/usr/bin/runsvdir", "/usr/bin/runsvdir", + "-P", "/etc/service") + info("Runit started as PID %d" % pid) + return pid + + +def wait_for_runit_or_interrupt(pid): + try: + status = waitpid_reap_other_children(pid) + return (True, status) + except KeyboardInterrupt: + return (False, None) + + +def shutdown_runit_services(quiet=False): + if not quiet: + debug("Begin shutting down runit services...") + os.system("/usr/bin/sv -w %d down /etc/service/* > /dev/null" % KILL_PROCESS_TIMEOUT) + + +def wait_for_runit_services(): + debug("Waiting for runit services to exit...") + done = False + while not done: + done = os.system("/usr/bin/sv status /etc/service/* | grep -q '^run:'") != 0 + if not done: + time.sleep(0.1) + # According to https://github.com/phusion/baseimage-docker/issues/315 + # there is a bug or race condition in Runit, causing it + # not to shutdown services that are already being started. + # So during shutdown we repeatedly instruct Runit to shutdown + # services. + shutdown_runit_services(True) + + +def install_insecure_key(): + info("Installing insecure SSH key for user root") + run_command_killable("/usr/sbin/enable_insecure_key") + + +def main(args): + import_envvars(False, False) + export_envvars() + + if args.enable_insecure_key: + install_insecure_key() + + if not args.skip_startup_files: + run_startup_files() + + runit_exited = False + exit_code = None + + if not args.skip_runit: + runit_pid = start_runit() + try: + exit_status = None + if len(args.main_command) == 0: + runit_exited, exit_code = wait_for_runit_or_interrupt(runit_pid) + if runit_exited: + if exit_code is None: + info("Runit exited with unknown status") + exit_status = 1 + else: + exit_status = os.WEXITSTATUS(exit_code) + info("Runit exited with status %d" % exit_status) + else: + info("Running %s..." % " ".join(args.main_command)) + pid = os.spawnvp(os.P_NOWAIT, args.main_command[0], args.main_command) + try: + exit_code = waitpid_reap_other_children(pid) + if exit_code is None: + info("%s exited with unknown status." % args.main_command[0]) + exit_status = 1 + else: + exit_status = os.WEXITSTATUS(exit_code) + info("%s exited with status %d." % (args.main_command[0], exit_status)) + except KeyboardInterrupt: + stop_child_process(args.main_command[0], pid) + raise + except BaseException: + warn("An error occurred. Aborting.") + stop_child_process(args.main_command[0], pid) + raise + sys.exit(exit_status) + finally: + if not args.skip_runit: + run_pre_shutdown_scripts() + shutdown_runit_services() + if not runit_exited: + stop_child_process("runit daemon", runit_pid) + wait_for_runit_services() + run_post_shutdown_scripts() + +# Parse options. +parser = argparse.ArgumentParser(description='Initialize the system.') +parser.add_argument('main_command', metavar='MAIN_COMMAND', type=str, nargs='*', + help='The main command to run. (default: runit)') +parser.add_argument('--enable-insecure-key', dest='enable_insecure_key', + action='store_const', const=True, default=False, + help='Install the insecure SSH key') +parser.add_argument('--skip-startup-files', dest='skip_startup_files', + action='store_const', const=True, default=False, + help='Skip running /etc/my_init.d/* and /etc/rc.local') +parser.add_argument('--skip-runit', dest='skip_runit', + action='store_const', const=True, default=False, + help='Do not run runit services') +parser.add_argument('--no-kill-all-on-exit', dest='kill_all_on_exit', + action='store_const', const=False, default=True, + help='Don\'t kill all processes on the system upon exiting') +parser.add_argument('--quiet', dest='log_level', + action='store_const', const=LOG_LEVEL_WARN, default=LOG_LEVEL_INFO, + help='Only print warnings and errors') +args = parser.parse_args() +log_level = args.log_level + +if args.skip_runit and len(args.main_command) == 0: + error("When --skip-runit is given, you must also pass a main command.") + sys.exit(1) + +# Run main function. +signal.signal(signal.SIGTERM, lambda signum, frame: ignore_signals_and_raise_keyboard_interrupt('SIGTERM')) +signal.signal(signal.SIGINT, lambda signum, frame: ignore_signals_and_raise_keyboard_interrupt('SIGINT')) +signal.signal(signal.SIGALRM, lambda signum, frame: raise_alarm_exception()) +try: + main(args) +except KeyboardInterrupt: + warn("Init system aborted.") + exit(2) +finally: + if args.kill_all_on_exit: + kill_all_processes(KILL_ALL_PROCESSES_TIMEOUT) diff --git a/universal-robot-simulator/5.3.1.64192/scripts/setuser b/universal-robot-simulator/5.3.1.64192/scripts/setuser new file mode 100644 index 0000000..df660bf --- /dev/null +++ b/universal-robot-simulator/5.3.1.64192/scripts/setuser @@ -0,0 +1,65 @@ +#!/usr/bin/python3 + +''' +Copyright (c) 2013-2015 Phusion Holding B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' + +import sys +import os +import pwd + + +def abort(message): + sys.stderr.write("setuser: %s\n" % message) + sys.exit(1) + + +def main(): + ''' + A simple alternative to sudo that executes a command as a user by setting + the user ID and user parameters to those described by the system and then + using execvp(3) to execute the command without the necessity of a TTY + ''' + + username = sys.argv[1] + try: + user = pwd.getpwnam(username) + except KeyError: + abort("user %s not found" % username) + os.initgroups(username, user.pw_gid) + os.setgid(user.pw_gid) + os.setuid(user.pw_uid) + os.environ['USER'] = username + os.environ['HOME'] = user.pw_dir + os.environ['UID'] = str(user.pw_uid) + try: + os.execvp(sys.argv[2], sys.argv[2:]) + except OSError as e: + abort("cannot execute %s: %s" % (sys.argv[2], str(e))) + +if __name__ == '__main__': + + if len(sys.argv) < 3: + sys.stderr.write("Usage: /sbin/setuser USERNAME COMMAND [args..]\n") + sys.exit(1) + + main() + From 2462f2cab91c42e465483b5d822a31385f5794bf Mon Sep 17 00:00:00 2001 From: mhofma Date: Tue, 23 Apr 2019 11:03:43 +0200 Subject: [PATCH 3/3] fix readme --- .../3.7.0.40195/README.md | 31 +++++++++++-------- .../5.3.1.64192/README.md | 7 +++-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/universal-robot-simulator/3.7.0.40195/README.md b/universal-robot-simulator/3.7.0.40195/README.md index d57e71e..7309002 100644 --- a/universal-robot-simulator/3.7.0.40195/README.md +++ b/universal-robot-simulator/3.7.0.40195/README.md @@ -1,13 +1,18 @@ -# Universal Robot Simulator - -**NOTE:** This image just for research. All rights of the offline simulator applications belong to [Universal Robots A/S](https://www.universal-robots.com). - - -## Usage -``` -docker run -it --security-opt label=disable \ - --device /dev/dri --env="DISPLAY" \ - --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ - -p 30001-30004:30001-30004 \ - --name="ursim" jacknlliu/ursim:3.4.1-59 start-ursim.sh UR5 -``` +# Universal Robot Simulator + +**NOTE:** This image just for research. All rights of the offline simulator applications belong to [Universal Robots A/S](https://www.universal-robots.com). + + +## Usage +``` +docker run -it --security-opt label=disable \ + --device /dev/dri --env="DISPLAY" \ + --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ + -p 30001-30004:30001-30004 \ + --name="ursim" mhofma/ursim:3.4.1-59 start-ursim.sh UR5 +``` + +## Build +docker build . -t mhofma/ursim:3.4.1-59 +docker run -it --rm --security-opt label=disable -e DISPLAY=192.168.20.125:0.0 --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --privileged -p 29999-30004:29999-30004 -p 502:502 --name="ursim" mhofma/ursim:3.4.1-59 start-ursim.sh UR10 + diff --git a/universal-robot-simulator/5.3.1.64192/README.md b/universal-robot-simulator/5.3.1.64192/README.md index 1091d19..9f0b5bc 100644 --- a/universal-robot-simulator/5.3.1.64192/README.md +++ b/universal-robot-simulator/5.3.1.64192/README.md @@ -5,8 +5,9 @@ ## Usage ``` -docker run -it --security-opt label=disable --device /dev/dri --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" -p 30001-30004:30001-30004 --name="ursim" jacknlliu/ursim:5.3.1.64192 start-ursim.sh UR10 +docker run -it --security-opt label=disable --device /dev/dri --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" -p 30001-30004:30001-30004 --name="ursim" mhofma/ursim:3.4.1-59 start-ursim.sh UR10 ``` -docker build . -t ursim:5.3.1.64192 -docker run -it --rm --security-opt label=disable -e DISPLAY=192.168.20.125:0.0 --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --privileged -p 29999-30004:29999-30004 -p 502:502 --name="ursim" ursim:5.3.1.64192 start-ursim.sh UR10 +## Build +docker build . -t mhofma/ursim:5.3.1.64192 +docker run -it --rm --security-opt label=disable -e DISPLAY=192.168.20.125:0.0 --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --privileged -p 29999-30004:29999-30004 -p 502:502 --name="ursim" mhofma/ursim:5.3.1.64192 start-ursim.sh UR10