From 653d4ed593cecd3e88e7dbe91711b585ce8d8cec Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Sat, 26 Jul 2014 13:49:02 +0530 Subject: [PATCH] readme: add note on changing security context of mounted volumes with selinux --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c07bdded..e9465ebb 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,14 @@ GitLab is a code hosting software and as such you don't want to lose your code w Volumes can be mounted in docker by specifying the **'-v'** option in the docker run command. +SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux. + +```bash +mkdir -p /opt/gitlab/data +sudo chcon -Rt svirt_sandbox_file_t /opt/gitlab/data +``` + ```bash -mkdir /opt/gitlab/data docker run --name=gitlab -d \ -v /opt/gitlab/data:/home/git/data \ sameersbn/gitlab:7.1.0 @@ -164,8 +170,14 @@ GitLab uses a database backend to store its data. This docker image is configured to use a MySQL database backend. The database connection can be configured using environment variables. If not specified, the image will start a mysql server internally and use it. However in this case, the data stored in the mysql database will be lost if the container is stopped/deleted. To avoid this you should mount a volume at /var/lib/mysql. +SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux. + +```bash +mkdir -p /opt/gitlab/mysql +sudo chcon -Rt svirt_sandbox_file_t /opt/gitlab/mysql +``` + ```bash -mkdir /opt/gitlab/mysql docker run --name=gitlab -d \ -v /opt/gitlab/data:/home/git/data \ -v /opt/gitlab/mysql:/var/lib/mysql sameersbn/gitlab:7.1.0