Difference between revisions of "Docker"

From Univention Wiki

Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
  
 
== Installation ==
 
== Installation ==
 
+
docker is part of UCS since UCS 4.0-2. It can be installed with the following command
docker packages can be installed with the following commands
 
 
<source lang=bash>
 
<source lang=bash>
ucr set repository/online/component/docker=enabled \
 
        repository/online/component/docker/unmaintained=enabled
 
 
univention-install docker.io
 
univention-install docker.io
 
</source>
 
</source>
Line 28: Line 25:
 
A generic UCS docker image can be downloaded by the following command
 
A generic UCS docker image can be downloaded by the following command
 
<pre>
 
<pre>
docker pull univention/generic-ucs-4.0-1-update-amd64
+
docker pull univention/ucs-generic-amd64:4.0-1
 
</pre>
 
</pre>
  
Line 35: Line 32:
 
docker run -d -e rootpwd=univention --hostname=dockertest \
 
docker run -d -e rootpwd=univention --hostname=dockertest \
 
   --name=dockertest_container \
 
   --name=dockertest_container \
     -p 8011:80 univention/generic-ucs-4.0-1-update-amd64 /sbin/init
+
     -p 8011:80 univention/ucs-generic-amd64:4.0-1 /sbin/init
 
</pre>
 
</pre>
  
Line 49: Line 46:
 
The first UCS system must always be a domaincontroller master. Univention provides pre-defined images for this setup which can be downloaded by the following command:
 
The first UCS system must always be a domaincontroller master. Univention provides pre-defined images for this setup which can be downloaded by the following command:
 
<pre>
 
<pre>
docker pull univention/master-ucs-4.0-1-update-amd64
+
docker pull univention/ucs-master-amd64:4.0-1
 
</pre>
 
</pre>
  
Line 55: Line 52:
 
<pre>
 
<pre>
 
docker run -d -e rootpwd=univention --hostname=master --name=master \
 
docker run -d -e rootpwd=univention --hostname=master --name=master \
     -p 8011:80 univention/master-ucs-4.0-1-update-amd64 /sbin/init
+
     -p 8011:80 univention/ucs-master-amd64:4.0-1 /sbin/init
 
</pre>
 
</pre>
  
Line 65: Line 62:
 
Some apps need a local running OpenLDAP server. For this case, Univention provides pre-defined DC slave images which can be downloaded by the following command:
 
Some apps need a local running OpenLDAP server. For this case, Univention provides pre-defined DC slave images which can be downloaded by the following command:
 
<pre>
 
<pre>
docker pull univention/slave-ucs-4.0-1-update-amd64
+
docker pull univention/ucs-slave-amd64:4.0-1
 
</pre>
 
</pre>
  
Line 71: Line 68:
 
<pre>
 
<pre>
 
docker run -d -e rootpwd=univention --hostname=slave --name=slave \
 
docker run -d -e rootpwd=univention --hostname=slave --name=slave \
     -p 8012:80 univention/master-ucs-4.0-1-update-amd64 /sbin/init
+
     -p 8012:80 univention/ucs-slave-amd64:4.0-1 /sbin/init
 
</pre>
 
</pre>
  
Line 81: Line 78:
 
Most applications use the system role member server which doesn't use a local OpenLDAP server. Univention provides pre-defined images for this setup which can be downloaded by the following command:
 
Most applications use the system role member server which doesn't use a local OpenLDAP server. Univention provides pre-defined images for this setup which can be downloaded by the following command:
 
<pre>
 
<pre>
docker pull univention/member-ucs-4.0-1-update-amd64
+
docker pull univention/ucs-member-amd64:4.0-1
 
</pre>
 
</pre>
  
Line 87: Line 84:
 
<pre>
 
<pre>
 
docker run -d -e rootpwd=univention --hostname=member --name=member \
 
docker run -d -e rootpwd=univention --hostname=member --name=member \
     -p 8013:80 univention/member-ucs-4.0-1-update-amd64 /sbin/init
+
     -p 8013:80 univention/ucs-member-amd64:4.0-1 /sbin/init
 
</pre>
 
</pre>
  
 
The started docker container is available after some seconds and can be configured through the web based appliance setup wizard. In the example above the port 8013 of the docker host is redirected to the port 80 of the container. Thus, the HTTP port of the docker container can reached by typing http://<IP of the docker host>:8013.
 
The started docker container is available after some seconds and can be configured through the web based appliance setup wizard. In the example above the port 8013 of the docker host is redirected to the port 80 of the container. Thus, the HTTP port of the docker container can reached by typing http://<IP of the docker host>:8013.
 
Alternatively, the container can be configured automatically configured via a  [http://docs.univention.de/installation-4.0.html#appliance:use:auto:profile profile file]
 
Alternatively, the container can be configured automatically configured via a  [http://docs.univention.de/installation-4.0.html#appliance:use:auto:profile profile file]
 +
 +
= Building Univention UCS docker images =
 +
 +
Über docker.knut.univention.de oder
 +
* http://jenkins.knut.univention.de:8080/job/Mitarbeiter/job/Arvid%20Requate/
  
 
= Docker first steps =
 
= Docker first steps =
Line 101: Line 103:
  
 
[[Category:Development]]
 
[[Category:Development]]
 
+
<!--[[Category:Docker]]-->
[[Category:Docker]]
 

Latest revision as of 12:21, 4 November 2016

Produktlogo UCS Version 4.0

Docker with UCS

Docker is an open-source project that automates the deployment of applications inside software containers.

Installation

docker is part of UCS since UCS 4.0-2. It can be installed with the following command

univention-install docker.io

After that, docker is ready to use:

~# docker -v
Docker version 1.3.2, build 39fa2fa

Using UCS docker images

Univention provides several docker images: https://registry.hub.docker.com/u/univention/.

Setup a generic UCS system via docker

A generic UCS docker image can be downloaded by the following command

docker pull univention/ucs-generic-amd64:4.0-1

Then, a new UCS docker container can be started in the following way

docker run -d -e rootpwd=univention --hostname=dockertest \
   --name=dockertest_container \
    -p 8011:80 univention/ucs-generic-amd64:4.0-1 /sbin/init

A shell in the docker container can be started by

docker exec -it dockertest_container /bin/bash

The started docker container can easily be configured through the web based appliance setup wizard. In the example above the port 8011 of the docker host is redirected to the port 80 of the container. Thus, the HTTP port of the docker container can reached by typing http://<IP of the docker host>:8011.

Setup a DC master via docker

The first UCS system must always be a domaincontroller master. Univention provides pre-defined images for this setup which can be downloaded by the following command:

docker pull univention/ucs-master-amd64:4.0-1

The new UCS docker container can be started in the following way

docker run -d -e rootpwd=univention --hostname=master --name=master \
    -p 8011:80 univention/ucs-master-amd64:4.0-1 /sbin/init

The started docker container is available after some seconds and can be configured through the web based appliance setup wizard. In the example above the port 8011 of the docker host is redirected to the port 80 of the container. Thus, the HTTP port of the docker container can reached by typing http://<IP of the docker host>:8011. Alternatively, the container can be configured automatically configured via a profile file

Setup a DC slave via docker

Some apps need a local running OpenLDAP server. For this case, Univention provides pre-defined DC slave images which can be downloaded by the following command:

docker pull univention/ucs-slave-amd64:4.0-1

The new UCS docker container can be started in the following way

docker run -d -e rootpwd=univention --hostname=slave --name=slave \
    -p 8012:80 univention/ucs-slave-amd64:4.0-1 /sbin/init

The started docker container is available after some seconds and can be configured through the web based appliance setup wizard. In the example above the port 8012 of the docker host is redirected to the port 80 of the container. Thus, the HTTP port of the docker container can reached by typing http://<IP of the docker host>:8012. Alternatively, the container can be configured automatically configured via a profile file

Setup a member server via docker

Most applications use the system role member server which doesn't use a local OpenLDAP server. Univention provides pre-defined images for this setup which can be downloaded by the following command:

docker pull univention/ucs-member-amd64:4.0-1

The new UCS docker container can be started in the following way

docker run -d -e rootpwd=univention --hostname=member --name=member \
    -p 8013:80 univention/ucs-member-amd64:4.0-1 /sbin/init

The started docker container is available after some seconds and can be configured through the web based appliance setup wizard. In the example above the port 8013 of the docker host is redirected to the port 80 of the container. Thus, the HTTP port of the docker container can reached by typing http://<IP of the docker host>:8013. Alternatively, the container can be configured automatically configured via a profile file

Building Univention UCS docker images

Über docker.knut.univention.de oder

Docker first steps

  1. List images
    docker images
  2. List running containers
    docker ps
  3. Get shell
    docker exec -it member /bin/bash
  4. Restart a container
    docker restart member
Personal tools