Adding rosbridge_suite to a pre-built Docker image

asked 2020-03-15 21:21:40 -0500

miguelgu gravatar 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!

edit retag flag offensive close merge delete

Comments

1

Have you ran apt update first? A properly structured Dockerfile will remove all apt indices and cache files, which typically leads to the kinds of errors getting printed which you quote.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-16 03:41:04 -0500 )edit

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.

miguelgu gravatar image miguelgu  ( 2020-03-18 01:20:59 -0500 )edit

You can just create a docker file the builds FROMthat 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/refere... . For example https://github.com/osrf/docker_images...

ruffsl gravatar image ruffsl  ( 2020-03-18 03:02:10 -0500 )edit

@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?

miguelgu gravatar image miguelgu  ( 2020-03-19 23:57:11 -0500 )edit

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/devel...

ruffsl gravatar image ruffsl  ( 2020-03-22 03:34:56 -0500 )edit