Docker: Unterschied zwischen den Versionen
Aus Alexander's Wiki
Admin (Diskussion | Beiträge) K (→Verwaltung) |
Admin (Diskussion | Beiträge) K (→Special Gitlab) |
||
Zeile 56: | Zeile 56: | ||
--volume=/srv/docker/gitlab/mysql:/var/lib/mysql \ | --volume=/srv/docker/gitlab/mysql:/var/lib/mysql \ | ||
sameersbn/mysql:latest | sameersbn/mysql:latest | ||
</source> | |||
The above command will create a database named gitlabhq_production and also create a user named gitlab with the password password with full/remote access to the gitlabhq_production database. | |||
<source lang="bash" enclose="div"> | |||
docker.io run -i -t sameersbn/gitlab /bin/bash --link=mysql-gitlab:mysql | docker.io run -i -t sameersbn/gitlab /bin/bash --link=mysql-gitlab:mysql | ||
</source> | </source> |
Version vom 20. Juni 2015, 21:22 Uhr
Installation
Paket für Ubuntu
apt-get install docker.io lxc
Docker Image
docker.io run -p 666:80 -i -t ubuntu:12.04 /bin/bash
Der lokale Port 666 zeigt auf den Port 80 im Docker-Image.
Verwaltung
Anzeige der verfügbaren Container
docker.io ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc65f386f2d5 nginx:1 nginx 9 months ago Exited (1) 8 months ago 0.0.0.0:7890->80/tcp dc-nginx
Container starten
docker.io start cc65f386f2d5
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc65f386f2d5 nginx:1 nginx 9 months ago Up 3 seconds 0.0.0.0:7890->80/tcp dc-nginx
Container stoppen
docker.io stop cc65f386f2d5
Container löschen
docker.io rm cc65f386f2d5
Docker Container finden
docker.io search gitlab
Benutzung
docker.io attach cc65f386f2d5
Special Gitlab
docker run --name=mysql-gitlab -d \
--env='DB_NAME=gitlabhq_production' \
--env='DB_USER=gitlab' --env='DB_PASS=password' \
--volume=/srv/docker/gitlab/mysql:/var/lib/mysql \
sameersbn/mysql:latest
The above command will create a database named gitlabhq_production and also create a user named gitlab with the password password with full/remote access to the gitlabhq_production database.
docker.io run -i -t sameersbn/gitlab /bin/bash --link=mysql-gitlab:mysql