Curl: not found

When I run

sudo docker build -t xxxx .

This error appeared:

/bin/sh: 1: curl: not found
Warning: apt-key output should not be parsed (stdout is not a terminal)
gpg: no valid OpenPGP data found.

The command in my Dockerfile is:
RUN curl -s | sudo apt-key add -

I already installed curl on my ubuntu 18.04.

Could someone help me with this? Much appreciated!


Can you share your Dockerfile?

You need curl in the image (in your dockerfile)
Not on your host

Thank you for the reply. THE DOCKER FILE:

FROM osrf/ros:melodic-desktop-full
MAINTAINER Quentin Rouxel

#Fix ROS GPG key 
RUN curl -s | sudo apt-key add -
#Upgrade the system
RUN apt clean && apt-get update && apt-get --with-new-pkgs upgrade -y

#Install standart, ros and gazebo packages
RUN apt-get update && apt-get install -y --allow-unauthenticated --fix-missing \
    #Install essential tools and libraries
    apt-utils build-essential tree wget git vim ctags \
    net-tools openssh-client rsyslog software-properties-common \
    gdb htop valgrind emacs strace ltrace unzip gnuplot gnuplot-qt \
    libjsoncpp-dev libncurses5-dev netcat usbutils libtclap-dev \
    python-catkin-tools \
    #Install Franka library
    ros-melodic-libfranka ros-melodic-franka-description \
    #Install OpenGL related libraries
    libglew-dev glew-utils mesa-utils mesa-utils-extra \
    #Install SFML
    libsfml-dev \
    #Install v4l2
    libv4l-0 libv4l-dev \
    #Install turbo jpeg
    libturbojpeg libturbojpeg0-dev \
    #Install LAPACK
    libopenblas-dev liblapack-dev liblapacke-dev \
    #Install pip2 and python2 packages
    python-pip python-tk \
    #Install pip3 and python3 packages
    python3-pip python3-tk ros-melodic-eigenpy ros-melodic- \
    #Clean up
    && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#Install Python2 packages
RUN pip2 install --upgrade pip && pip2 install quadprog scipy

#Install Python3 and PyBullet environment
RUN pip3 install --upgrade pip && pip3 install numpy pybullet matplotlib scipy scikit-build
#Install PyTorch
RUN pip3 install torch==1.7.0+cpu -f
#Install DRL environment
RUN pip3 install gym

#Configure Vim
RUN rm -rf /root/.vim \
    && git clone /root/.vim/ \
    && ln -sf /root/.vim/vimrc.vim /root/.vimrc

#Update bashrc
COPY tmp_bashrc /root/.bashrc

#Create and initialize workspace directory
RUN mkdir -p /WorkspaceUoE/src \
    && cd /WorkspaceUoE/src/ \
    && /bin/bash -c \
    "source /opt/ros/melodic/setup.bash && catkin_init_workspace" \
    && git clone \
    && git clone \
    && git clone \
    && git clone \
    && git clone \
    && cd pinocchio && git submodule update --init \
    && cd /WorkspaceUoE/ \
    && /bin/bash -c \
    "source /opt/ros/melodic/setup.bash \
    && catkin config --install --extend /opt/ros/melodic/ --cmake-args \
    -DCMAKE_CXX_FLAGS='-Wall -W' \
    && catkin build -j3"

#Setup symbolic link to franka_description inside 
#install directory to accommodate PyBullet URDF loader
RUN ln -s /opt/ros/melodic/share/franka_description/ /WorkspaceUoE/install/share/

#Install proprietary OptoForce API
COPY optoforce_linux_api_v1.5.1.tar.gz /tmp/optoforce_linux_api_v1.5.1.tar.gz
RUN cd /tmp/ \
    && tar xvf optoforce_linux_api_v1.5.1.tar.gz \
    && cp -r LINUX_API_V1.5.1/include/omd/ /usr/local/include/ \
    && cp LINUX_API_V1.5.1/lib/* /usr/local/lib/ \
    && rm -rf optoforce_linux_api_v1.5.1.tar.gz LINUX_API_V1.5.1/

#Install proprietary ForceDimension API
COPY forcedimension_linux_sdk_v3.7.3.tar.gz /tmp/forcedimension_linux_sdk_v3.7.3.tar.gz
RUN cd /tmp/ \
    && tar xvf forcedimension_linux_sdk_v3.7.3.tar.gz \
    && cp sdk-3.7.3/include/* /usr/local/include/ \
    && cp sdk-3.7.3/lib/release/lin-x86_64-gcc/* /usr/local/lib/ \
    && rm -rf forcedimension_linux_sdk_v3.7.3.tar.gz sdk-3.7.3

#Install LibTorch C++ API
RUN cd /tmp/ \
    && wget \
    && unzip \
    && cp -r libtorch/include/* /usr/local/include/ \
    && cp -r libtorch/lib/* /usr/local/lib/ \
    && cp -r libtorch/share/* /usr/local/share/ \
    && rm -rf libtorch*

#Update entrypoint script
ENTRYPOINT ["/bin/bash", "--init-file", "/"] 

Another problem is that when I try to

catkin build

my ros workspace, there’s an error saying:

Could not find a package configuration file provided by
“controller_interface” with any of the following names:


Really appreciate your help!

I think @terpz answered your first question. The second question might not be a Docker issue. I don’t know anything about catkin. You need to make sure your configuration files are copied into the image.

I also fixed your post since you acidentally copied the content of your Dockerfile twice.

Thank you @terpz, I think your suggestion works.
I figured out the problem is caused by the recent update of /osrf/ros:melodic-desktop-full image. This Dockerfile used to work and the workspace could compile. But now it’s not working any more. I still need to find out a solution.