Docker on Ubuntu 16.04

. 2 min read

Update 19-Dec-2018

I just retried and this seems to work perfectly on a new ubuntu instance:

bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker

# Test docker
sudo docker run hello-world

I'm getting started on using this amazing containerization technology that seems to be very stable and widely used now called Docker.

As I curently understand, Docker is basically a way to distribute and run platform (or code) seamlessly across platforms without getting into the typical "does not work on my machine" problems ;-)

Most things on Docker seem to be well documented and straightfoward ... well ... except that getting Docker running on my awesome Ubuntu 16.04 machine as always seemed to be a pain :-)

So here is how I finally managed to get it up and running!

First .... my config using lsb_release -a

Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:        16.04
Codename:       xenial

Installing Docker on Ubuntu 16.04 is very straightforward as documented.

Update apt and install the GPG key

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Edit the sources file

sudo vim /etc/apt/sources.list.d/docker.list

Remove everything in it and add deb https://apt.dockerproject.org/repo ubuntu-xenial main

Save and close the /etc/apt/sources.list.d/docker.list file

Update the APT package index

sudo apt-get update

Purge the old repo if it exists: sudo apt-get purge lxc-docker

Verify that APT is pulling from the right repository apt-cache policy docker-engine

Install Docker!

sudo apt-get update
sudo apt-get install docker-engine
sudo service docker start

Verify that Docker is running using sudo docker run hello-world


Simple so far? Yeah!

Now ... here is the damn teething problem .... docker pull just wouldn't work!!! WTF!?

I kept getting this damn error!!!

Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon. Is the docker daemon running on this host?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

After almost 30 mins of tinkering around ... I landed on this page that described the error 288455

Install the Docker.io package. But doesn't work on the Ubuntu Xenial Xerus (16.04)

If you scroll down to the end of the page, #4 describes the problem .... its the infamous permissions thingy! ;-)

As mentioned in this post,
I ran the following to add my USER to the docker group and everything worked just fine once I logged out and logged back in!!!

bash
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart

That's it! Yipee!! Docker is up and running!

Once you get a docker image running ... you can list them out using docker ps


Tags

AWS Analytics Antifragile Apache Spark Apple Apps Arbitrage Automation Awesome BBMP Bangalore Black Swan Bonds Boonex Bootstrap Brokerage Charges CFPB CMS CSS Calypso Camelot Capital Markets Charts Chirp Choropleth Chrome Code Igniter Collections Containerization Converters Cycling DalalBeat Data Analytics Data Journalism Data Mining Data Munging Data Privacy Data Science Databases Debt Design Design Stock DesignStock Diet Django Docker Document Processing Dropbox Electron Electronics Entertainment Entrepreneurship Exercise FFMPEG Facebook Finance Fire TV Stick Fitness Forerunner From-The-News Fun Futures Gaana Garmin General Geocoding Getting Started Ghost Google APIs GraphicsMagick HHVM HTTPS Hackathon Hacks Hardware Health House Keeping Housing IBM BlueMix IBrokers IPinfo Ideas Image Conversion Image Processing Infographics Interactive Brokers Internet Investing IoT Legal Lets Encrypt Mac Machine Learning Mailbox app Mapbox Markdown Marketing Meteor Mockups MongoDB Mortgages Movies Music MyPad MySQL Nativefier Nature Netflix Newsletters Nginx Node.js Notes OCR OSX Open Source OpenCPU Options PDF PHP Pebble Peloton Personal Photography Picture Platforms Plex Portable Apps Productivity Property Tax PyroCMS Quantitative Finance R-Project Random Raspberry Pi Research Resources Reticulate Robot S3 SQLite STT Scraping Security Server Shell Shiny Side Project Sikuli Speech Recognition Spider Pro Spinning Spotify Startup Resources Startups Strategy Sublime Text System Monitoring Tax Terminal Tips To Do Tools Torrent Trading Trends Troubleshooting USElection2016 Ubuntu Unix Valuations Video Conversion Visualization Wagtail Wearables Weekend Fun WhatsApp Wordpress anaconda annie bash catalina cv2 daily coding dailycoding data.table debugging devtools downloader e-Signatures ggplot git go google maps hat-tip iOS iPad iPhone iTunes javascript jupyter logging macos numpy opencv optionality plotly python rstats videos youtube