Using chef to set up apt repository

I am creating a recipe to install docker on Ubuntu 14.

How do I translate the command above to chef?}

  • Disable docker container log configuration in Chef
  • Installing chef server in Centos 6.6 docker container
  • Platform to test with docker containers in developer environment
  • Kitchen doesn't recognise docker
  • What's the difference between Docker and Chef's new Habitat tool?
  • AWS opswork docker: Missing Cookbooks:No such cookbook: docker
  • sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    

    So using apt-repository resource:

    apt_repository "???" do
      uri ???
      distribution ???
      components ???
      keyserver "hkp://p80.pool.sks-keyservers.net:80"
      key "58118E89F3A912897C070ADBF76221572C52609D"
    end
    

  • Docker registering containers address as a host on Zookeeper
  • Prometheus - Docker/JVM Monitoring
  • How to run *BSD OS on Docker?
  • running mongoexport from inside one container to another within a docker-compose stack
  • Docker Tomcat7 container not always starting correctly
  • DEIS no public IP's
  • 2 Solutions collect form web for “Using chef to set up apt repository”

    In contrast to @kaboom, I would recommend the (more modern) apt cookbook maintained by Chef, which also allows to set up repos. The syntax is basically the same.

    This is, how I install Docker (on Debian):

    apt_repository "docker" do
      uri "https://apt.dockerproject.org/repo"
      distribution "#{node['platform']}-#{node['lsb']['codename']}"
      components ["main"]
      key "https://apt.dockerproject.org/gpg"
    end
    

    EDIT: This is also available in Chef core without any cookbook as of 12.9.

    EDIT2: Of course, you can also supply the keyserver and key_id parameters, if you want to specify it as such.

    You’re looking for something like:

    apt_repo "foobar" do
      keyserver "hkp://p80.pool.sks-keyservers.net:80"
      key_id "58118E89F3A912897C070ADBF76221572C52609D"
      key_package "foobar-debian-keyring"
      url "http://deb.example.org/"
      distribution "foobar-stable"
      components ["free", "non-free"]
      source_packages true
    end
    

    …as per https://supermarket.chef.io/cookbooks/apt-repo documentation.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.