Docker: Difference between revisions
From charlesreid1
(→Linux) |
|||
| Line 18: | Line 18: | ||
Linode supports docker: https://blog.linode.com/2014/01/03/docker-on-linode/ | 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 | |||
===Ubuntu=== | |||
Guide to installing Docker on Ubuntu Linux: https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |||
Start by setting up Docker's repositories: | |||
<pre> | |||
$ sudo apt-get install \ | |||
apt-transport-https \ | |||
ca-certificates \ | |||
curl \ | |||
software-properties-common | |||
</pre> | |||
Add Docker's GPG key: | |||
<pre> | |||
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |||
</pre> | |||
Verify fingerprint starts with 9DC8: | |||
<pre> | |||
$ sudo apt-key fingerprint 0EBFCD88 | |||
</pre> | |||
Set up the stable repository: | |||
<pre> | |||
$ sudo add-apt-repository \ | |||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |||
$(lsb_release -cs) \ | |||
stable" | |||
</pre> | |||
Install docker by updating package index and running install: | |||
<pre> | |||
$ sudo apt-get update | |||
$ sudo apt-get install docker-ce | |||
</pre> | |||
Test it out: | |||
<pre> | |||
$ sudo docker run hello-world | |||
</pre> | |||
==Mac== | ==Mac== | ||
You can run docker on Mac: https://docs.docker.com/docker-for-mac/ | You can run docker on Mac: https://docs.docker.com/docker-for-mac/ | ||
Revision as of 07:35, 22 March 2017
Overview
What is Docker
Docker is a way of deploying apps on servers. It packages apps into side-by-side containers. These are similar in spirit to virtual machines, but different because containers are not (or, don't have to be) fully bundled operating systems. The container system makes sure everything runs the same everywhere.
It's like Homebrew or Aptitude for apps.
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/
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
Ubuntu
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
Mac
You can run docker on Mac: https://docs.docker.com/docker-for-mac/