-
Tested under MacOS 10.13.6
-
dockerhub: https://hub.docker.com/r/floodshao/ros-melodic-desktop-vnc
-
github: https://github.com/FloodShao/ros-melodic-desktop-vnc
This docker environment is based on :
- osrf/docker_images for melodic_core
- consol/ubuntu-xfce-vnc for ubuntu-1604-vnc-desktop
- clone the repository in the github here
- command
docker build -t <image_name>/<tag_name> .
under the 'Dockerfile' directory.
Download the vnc viewer client here
docker pull floodshao/ros-melodic-desktop-vnc:v1.0
or build your own imagedocker run -it -p 5901:5901 -p 6901:6901 floodshao/ros-melodic-desktop-vnc:v1.0 /bin/bash
- You can reference the ubuntu-1604-vnc-desktop for user modification or password modification.
- open vnc viewer client, type the server address localhost:5901, key in the password: vncpassword
- open the terminal and test gazebo
The default user name is 'default', with the home dir is /headless.
If you want to attach a directory to this docker image, add the -v
param in the command as follow:
docker run -it -p 5901:5901 -p 6901:6901 -v /<host_dir>:/<docker_dir> ros_images/melodic-desktop /bin/bash
where <host_dir>
is the absolute dir in your host machine, and <docker_dir>
is the absolute dir in your docker.
For example, I will use -v /$(pwd)/workspace:/headless/workspace
to create a link between the host machine and the docker. After you delete the docker (stop the docker ps), the files in your host machine (as in /$(pwd)/workspace) will not disappear. You can use this feature to load your program locally to your docker environment rather than clone from your git repo each time.