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:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

    So using apt-repository resource:

    apt_repository "???" do
      uri ???
      distribution ???
      components ???
      keyserver "hkp://"
      key "58118E89F3A912897C070ADBF76221572C52609D"

  • 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 ""
      distribution "#{node['platform']}-#{node['lsb']['codename']}"
      components ["main"]
      key ""

    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://"
      key_id "58118E89F3A912897C070ADBF76221572C52609D"
      key_package "foobar-debian-keyring"
      url ""
      distribution "foobar-stable"
      components ["free", "non-free"]
      source_packages true

    …as per documentation.

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