Adding rosbridge_suite to a pre-built Docker image
I'm using this repository that has a ROS package to control physical Anki Vector home robot. I got it up and running, but when I do sudo apt-get install ros-melodic-rosbridge-server
to install rosbridge_suite I get Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
How would I go about installing rosbridge_suite to a pre-built Docker image?
Any help is appreciated, thank you!
Asked by miguelgu on 2020-03-15 21:21:40 UTC
Comments
Have you ran
apt update
first? A properly structuredDockerfile
will remove allapt
indices and cache files, which typically leads to the kinds of errors getting printed which you quote.Asked by gvdhoorn on 2020-03-16 03:41:04 UTC
Thank you, that worked! Is there a way to have it saved? When I run the Dockerfile again I have to do the
apt update
every time.Asked by miguelgu on 2020-03-18 01:20:59 UTC
You can just create a docker file the builds
FROM
that base image to create a child image on top that could install what you need. This layering of images is a common pattern in using docker: https://docs.docker.com/engine/reference/builder/#from . For example https://github.com/osrf/docker_images/blob/master/ros/eloquent/ubuntu/bionic/ros1-bridge/DockerfileAsked by ruffsl on 2020-03-18 03:02:10 UTC
@ruffsl Would it be ideal to download his Docker file and adding the stuff I need or would it be better to just create a child image?
Asked by miguelgu on 2020-03-19 23:57:11 UTC
It depends on what control you need to customize by forking or what complexity you'd like to avoid by just building from. That being said, I think the dockerfile linked could be a bit cleaner: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
Asked by ruffsl on 2020-03-22 03:34:56 UTC