8

I ran add-apt-repository ppa:ubuntu-wine/ppa in docker container, but failed with the notice:

Cannot add PPA: 'ppa:ppaname/ppa'.
Please check that the PPA name or format is crrect.

Hower it worked on the host.

After googled a lot,I've tried the followings:

apt-get install python-software-properties
apt-get install software-properties-common
apt-get install --reinstall ca-certificates

and didn't work.

The system on host is ubuntu 14.04,64bit.

The image of container is based on ubuntu 14.04 from DOCKER HUB.

Can anybody help me?

kenorb
  • 155,785
  • 88
  • 678
  • 743
zhenxing1114
  • 91
  • 1
  • 1
  • 2

3 Answers3

19

I'm not sure what went wrong with you.

Here's how I got it working:

$ docker run -t -i --rm ubuntu:14.04 /bin/bash

And inside the container
# apt-get update && apt-get install -y software-properties-common
# add-apt-repository ppa:ubuntu-wine/ppa
# apt-get update
Fedalto
  • 1,507
  • 1
  • 10
  • 13
0

Try defining this var before

LC_ALL=C.UTF-8 add-apt-repository ppa:ppaname/ppa
Lu32
  • 810
  • 1
  • 9
  • 18
0

I had to run an early apt-get update to get my PPA working inside my dockerfile.

    RUN apt-get update
    RUN apt-get install --reinstall ca-certificates
    #...time passes...
    RUN add-apt-repository -y 'ppa:openjdk-r/ppa' && apt-get update
patrick
  • 16,091
  • 29
  • 100
  • 164