2015-06-07 23:07:20 -04:00
|
|
|
<!--[metadata]>
|
|
|
|
+++
|
|
|
|
title = "Installation on Arch Linux"
|
|
|
|
description = "Installation instructions for Docker on ArchLinux."
|
|
|
|
keywords = ["arch linux, virtualization, docker, documentation, installation"]
|
|
|
|
[menu.main]
|
|
|
|
parent = "smn_linux"
|
|
|
|
+++
|
|
|
|
<![end-metadata]-->
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
# Arch Linux
|
|
|
|
|
|
|
|
Installing on Arch Linux can be handled via the package in community:
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
- [docker](https://www.archlinux.org/packages/community/x86_64/docker/)
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
or the following AUR package:
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
- [docker-git](https://aur.archlinux.org/packages/docker-git/)
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
The docker package will install the latest tagged version of docker. The
|
|
|
|
docker-git package will build from the current master branch.
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
Docker depends on several packages which are specified as dependencies
|
|
|
|
in the packages. The core dependencies are:
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
- bridge-utils
|
|
|
|
- device-mapper
|
|
|
|
- iproute2
|
|
|
|
- lxc
|
|
|
|
- sqlite
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
For the normal package a simple
|
|
|
|
|
2015-04-29 15:51:57 -04:00
|
|
|
$ sudo pacman -S docker
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
is all that is needed.
|
|
|
|
|
|
|
|
For the AUR package execute:
|
|
|
|
|
2015-10-06 02:55:02 -04:00
|
|
|
$ yaourt -S docker-git
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
The instructions here assume **yaourt** is installed. See [Arch User
|
|
|
|
Repository](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages)
|
|
|
|
for information on building and installing packages from the AUR if you
|
|
|
|
have not done so before.
|
|
|
|
|
|
|
|
## Starting Docker
|
|
|
|
|
|
|
|
There is a systemd service unit created for docker. To start the docker
|
|
|
|
service:
|
|
|
|
|
2014-05-01 10:13:34 -04:00
|
|
|
$ sudo systemctl start docker
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
To start on system boot:
|
|
|
|
|
2014-05-01 10:13:34 -04:00
|
|
|
$ sudo systemctl enable docker
|
2014-11-25 23:09:52 -05:00
|
|
|
|
|
|
|
## Custom daemon options
|
|
|
|
|
|
|
|
If you need to add an HTTP Proxy, set a different directory or partition for the
|
|
|
|
Docker runtime files, or make other customizations, read our systemd article to
|
2015-10-09 19:50:41 -04:00
|
|
|
learn how to [customize your systemd Docker daemon options](../articles/systemd.md).
|
2015-04-29 15:51:57 -04:00
|
|
|
|
2015-07-26 13:11:27 -04:00
|
|
|
## Running Docker with a manually-defined network
|
2015-07-26 04:10:42 -04:00
|
|
|
|
2015-07-26 13:11:27 -04:00
|
|
|
If you manually configure your network using `systemd-network` version 220 or
|
|
|
|
higher, containers you start with Docker may be unable to access your network.
|
|
|
|
Beginning with version 220, the forwarding setting for a given network
|
|
|
|
(`net.ipv4.conf.<interface>.forwarding`) defaults to *off*. This setting
|
|
|
|
prevents IP forwarding. It also conflicts with Docker which enables the
|
|
|
|
`net.ipv4.conf.all.forwarding` setting within a container.
|
|
|
|
|
|
|
|
To work around this, edit the `<interface>.network` file in
|
|
|
|
`/etc/systemd/network/` on your Docker host add the following block:
|
2015-07-26 04:10:42 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
[Network]
|
|
|
|
...
|
|
|
|
IPForward=kernel
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
2015-07-26 13:11:27 -04:00
|
|
|
This configuration allows IP forwarding from the container as expected.
|
2015-07-26 07:25:01 -04:00
|
|
|
## Uninstallation
|
|
|
|
|
|
|
|
To uninstall the Docker package:
|
|
|
|
|
|
|
|
$ sudo pacman -R docker
|
|
|
|
|
|
|
|
To uninstall the Docker package and dependencies that are no longer needed:
|
|
|
|
|
|
|
|
$ sudo pacman -Rns docker
|
|
|
|
|
|
|
|
The above commands will not remove images, containers, volumes, or user created
|
|
|
|
configuration files on your host. If you wish to delete all images, containers,
|
|
|
|
and volumes run the following command:
|
|
|
|
|
|
|
|
$ rm -rf /var/lib/docker
|
|
|
|
|
|
|
|
You must delete the user created configuration files manually.
|