Difference between revisions of "Docker"
From Univention Wiki
Line 20: | Line 20: | ||
</pre> | </pre> | ||
− | A UCS docker image can be downloaded by the following command | + | = 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 | ||
<pre> | <pre> | ||
docker pull univention/generic-ucs-4.0-1-update-amd64 | docker pull univention/generic-ucs-4.0-1-update-amd64 | ||
Line 28: | Line 34: | ||
<pre> | <pre> | ||
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/generic-ucs-4.0-1-update-amd64 /sbin/init | ||
</pre> | </pre> | ||
Line 54: | Line 60: | ||
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. | 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 [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] | ||
+ | |||
+ | == 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: | ||
+ | <pre> | ||
+ | docker pull univention/slave-ucs-4.0-1-update-amd64 | ||
+ | </pre> | ||
+ | |||
+ | The new UCS docker container can be started in the following way | ||
+ | <pre> | ||
+ | docker run -d -e rootpwd=univention --hostname=slave --name=slave \ | ||
+ | -p 8012:80 univention/master-ucs-4.0-1-update-amd64 /sbin/init | ||
+ | </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 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 [http://docs.univention.de/installation-4.0.html#appliance:use:auto:profile 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: | ||
+ | <pre> | ||
+ | docker pull univention/member-ucs-4.0-1-update-amd64 | ||
+ | </pre> | ||
+ | |||
+ | The new UCS docker container can be started in the following way | ||
+ | <pre> | ||
+ | docker run -d -e rootpwd=univention --hostname=member --name=member \ | ||
+ | -p 8013:80 univention/member-ucs-4.0-1-update-amd64 /sbin/init | ||
+ | </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. | ||
+ | Alternatively, the container can be configured automatically configured via a [http://docs.univention.de/installation-4.0.html#appliance:use:auto:profile profile file] | ||
+ | |||
+ | = Docker first steps == | ||
+ | # List images <pre>docker images</pre> | ||
+ | # List running containers <pre>docker ps</pre> | ||
+ | # Get shell <pre>docker exec -it member /bin/bash</pre> | ||
+ | # Restart a container <pre>docker restart member</pre> | ||
+ | |||
[[Category:Development]] | [[Category:Development]] | ||
[[Category:Docker]] | [[Category:Docker]] |
Revision as of 12:30, 28 April 2015
Contents
Docker with UCS
Docker is an open-source project that automates the deployment of applications inside software containers.
Installation
docker packages can be installed with the following commands
ucr set repository/online/component/docker=enabled \
repository/online/component/docker/unmaintained=enabled
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/generic-ucs-4.0-1-update-amd64
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/generic-ucs-4.0-1-update-amd64 /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/master-ucs-4.0-1-update-amd64
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/master-ucs-4.0-1-update-amd64 /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/slave-ucs-4.0-1-update-amd64
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/master-ucs-4.0-1-update-amd64 /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/member-ucs-4.0-1-update-amd64
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/member-ucs-4.0-1-update-amd64 /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
Docker first steps =
- List images
docker images
- List running containers
docker ps
- Get shell
docker exec -it member /bin/bash
- Restart a container
docker restart member