Skip to content
Filip Zorić edited this page May 27, 2024 · 3 revisions

How to use SSH keys?

Github removed support for the https cloning of private repositories. It is required to use SSH keys.

In order to build docker image with SSH keys, you can use this command:

DOCKER_BUILDKIT=1 docker build -t <img_name> --ssh default=${SSH_AUTH_SOCK} .

You can use ${SSH_AUTH_SOCK} after executing following commands:

eval $(ssh-agent)
ssh-add ~/.ssh/id_rsa

which basically add your private keys during docker image build.

Detailed explanation how to include SSH keys in your docker image can be found here.

CAUTION: Including SSH keys to your docker image is a substantial security risk!

Common issues

One of the main problems that occurs when using Docker files for robotic applications is expiration of GPG keys for ROS. More about this incident can be found here

In order to fix that, in case that some sudo apt-get update or sudo apt-get install fails, please replace GPG keys to newer ones. Error for expiration of GPG keys looks like following:

An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.ros.org/ros/ubuntu bionic InRelease: 
The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>

You can add keys by following 1.3 section in Installation instructions for corresponding ROS distribution.

If you already have docker image built, and you get following error message when trying to install new ROS package:


E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-melodic-sound-play/ros-melodic-sound-play_0.3.11-1bionic.20210414.224641_amd64.deb  404  Not Found [IP: 140.211.166.134 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

You can fix it by typing following command:

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

OCI Runtime error:

One of the errors, that shows up quite often is:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/tmp/.docker.xauth" to rootfs at "/tmp/.docker.xauth": mount /tmp/.docker.xauth:/tmp/.docker.xauth (via /proc/self/fd/7), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

Error is easily fixable with following commands:

sudo rm -rf /tmp/.docker.xauth

and,

sudo touch /tmp/.docker.xauth

Clone this wiki locally