Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apt-add-repository: command not found error in Dockerfile

Tags:

docker

apt-add-repository is just not in the base Ubuntu image. You'll first need to install it. try apt-get install software-properties-common

By the way, you don't need to use sudo in the Dockerfile because the commands run as root by default unless you change to another user with the USER command.


Add these lines before running apt-add-repository command

RUN apt-get update && \
    apt-get install -y software-properties-common && \
    rm -rf /var/lib/apt/lists/*