From charlesreid1

Revision as of 20:02, 24 March 2017 by Admin (talk | contribs) (Created page with "=Installing= Docker has great documentation on getting up and running: https://docs.docker.com/ Docker also provides several examples of docker-izing an app: https://docs.do...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Installing

Docker has great documentation on getting up and running: https://docs.docker.com/

Docker also provides several examples of docker-izing an app: https://docs.docker.com/engine/examples/

Ubuntu Linux

You can get docker running on many virtual hosting services.

Linode supports docker: https://blog.linode.com/2014/01/03/docker-on-linode/

They offer installation guides for different distributions: https://docs.docker.com/engine/installation/linux/#install-using-the-repository

Guide to installing Docker on Ubuntu Linux: https://docs.docker.com/engine/installation/linux/ubuntulinux/

Start by setting up Docker's repositories:

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

Add Docker's GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Verify fingerprint starts with 9DC8:

$ sudo apt-key fingerprint 0EBFCD88

Set up the stable repository:

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Install docker by updating package index and running install:

$ sudo apt-get update
$ sudo apt-get install docker-ce

Test it out:

$ sudo docker run hello-world


Errors

When I added Docker's repos to my aptitude following the instructions above, I kept seeing 403 errors from docker's repo when I ran apt-get update:

sudo apt-get update
...
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/wily/stable/binary-amd64/Packages  HttpError403

Yuck. Others have had this issue too. [1]

Resolving

Resolved the problem by visiting their apt repos with a browser and manually downloading/installing the .deb file.

Start with the name of your release:

$ lsb_release -c
Codename:                     wily

Now navigate to their aptitude repositories in your browser: https://apt.dockerproject.org/repo/pool/main/d/docker-engine/

Find the deb file that corresponds to your install and copy the link.

$ wget <link to .deb file> 

Now you can install it (you probably need to be sudo):

$ dpkg -i docker-engine_1.9.1-0~wily_amd64.deb
Selecting previously unselected package docker-engine.
(Reading database ... 142272 files and directories currently installed.)
Preparing to unpack docker-engine_1.9.1-0~wily_amd64.deb ...
Unpacking docker-engine (1.9.1-0~wily) ...
Setting up docker-engine (1.9.1-0~wily) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9.1) ...
Processing triggers for man-db (2.7.4-1) ...

Mac

You can run docker on Mac: https://docs.docker.com/docker-for-mac/


Docker on Linux Without Sudo

To modify Docker so it runs on Linux without requiring the use of the sudo command, create a docker group:

groupadd docker
usermod -a -G docker username

That's it - boom - you should be able to run the docker hello world without sudo:

$ docker hello-world # look ma, no sudo