2015-06-07 20:07:20 -07:00
<!-- [metadata]>
+++
title = "Installation on openSUSE and SUSE Linux Enterprise"
description = "Installation instructions for Docker on openSUSE and on SUSE Linux Enterprise."
keywords = ["openSUSE, SUSE Linux Enterprise, SUSE, SLE, docker, documentation, installation"]
[menu.main]
parent = "smn_linux"
+++
<![end-metadata]-->
2014-04-16 10:53:12 +10:00
# openSUSE
Docker is available in **openSUSE 12.3 and later** . Please note that due
2014-11-16 15:14:45 -05:00
to its current limitations Docker is able to run only **64 bit** architecture.
2014-04-16 10:53:12 +10:00
2014-11-16 15:14:45 -05:00
Docker is not part of the official repositories of openSUSE 12.3 and
2015-04-25 14:57:01 -04:00
openSUSE 13.1. Hence it is necessary to add the [Virtualization
2014-11-16 15:14:45 -05:00
repository](https://build.opensuse.org/project/show/Virtualization) from
[OBS ](https://build.opensuse.org/ ) to install the `docker` package.
2014-04-16 10:53:12 +10:00
2014-11-16 15:14:45 -05:00
Execute one of the following commands to add the Virtualization repository:
2014-04-16 10:53:12 +10:00
# openSUSE 12.3
2014-05-01 17:13:34 +03:00
$ sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_12.3/ Virtualization
2014-04-16 10:53:12 +10:00
# openSUSE 13.1
2014-05-01 17:13:34 +03:00
$ sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_13.1/ Virtualization
2014-11-16 15:14:45 -05:00
No extra repository is required for openSUSE 13.2 and later.
# SUSE Linux Enterprise
Docker is available in **SUSE Linux Enterprise 12 and later** . Please note that
due to its current limitations Docker is able to run only on **64 bit**
architecture.
2015-04-29 12:51:57 -07:00
## Installation
2014-04-16 10:53:12 +10:00
Install the Docker package.
2014-05-01 17:13:34 +03:00
$ sudo zypper in docker
2014-04-16 10:53:12 +10:00
2014-04-23 23:48:28 +03:00
Now that it's installed, let's start the Docker daemon.
2014-04-16 10:53:12 +10:00
2014-05-01 17:13:34 +03:00
$ sudo systemctl start docker
2014-04-16 10:53:12 +10:00
If we want Docker to start at boot, we should also:
2014-05-01 17:13:34 +03:00
$ sudo systemctl enable docker
2014-04-16 10:53:12 +10:00
The docker package creates a new group named docker. Users, other than
root user, need to be part of this group in order to interact with the
2014-06-27 12:45:55 -07:00
Docker daemon. You can add users with:
2014-04-16 10:53:12 +10:00
2014-08-19 16:03:51 -06:00
$ sudo /usr/sbin/usermod -a -G docker < username >
2014-04-16 10:53:12 +10:00
2014-06-25 15:36:14 +02:00
To verify that everything has worked as expected:
2014-08-07 15:41:23 +02:00
$ sudo docker run --rm -i -t opensuse /bin/bash
This should download and import the `opensuse` image, and then start `bash` in
a container. To exit the container type `exit` .
If you want your containers to be able to access the external network you must
enable the `net.ipv4.ip_forward` rule.
This can be done using YaST by browsing to the
2015-08-03 12:01:25 +02:00
`System -> Network Settings -> Routing` menu (for openSUSE Tumbleweed and later) or `Network Devices -> Network Settings -> Routing` menu (for SUSE Linux Enterprise 12 and previous openSUSE versions) and ensuring that the `Enable IPv4 Forwarding` box is checked.
2014-08-07 15:41:23 +02:00
This option cannot be changed when networking is handled by the Network Manager.
In such cases the `/etc/sysconfig/SuSEfirewall2` file needs to be edited by
hand to ensure the `FW_ROUTE` flag is set to `yes` like so:
FW_ROUTE="yes"
2014-06-25 15:36:14 +02:00
2014-04-23 23:48:28 +03:00
**Done!**
2014-05-22 07:05:19 +10:00
2014-11-26 14:09:52 +10: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
learn how to [customize your systemd Docker daemon options ](/articles/systemd/ ).
2015-04-29 12:51:57 -07:00
## Uninstallation
To uninstall the Docker package:
$ sudo zypper rm docker
The above command 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.
2014-11-26 14:09:52 +10:00
## What's next
2014-05-22 07:05:19 +10:00
Continue with the [User Guide ](/userguide/ ).