Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Mounting volumes with :Z flag to avoid permission issues on CentOS (f…
Browse files Browse the repository at this point in the history
…ixes #196)
  • Loading branch information
vania-pooh committed Oct 30, 2018
1 parent 3b58a89 commit 0bf53e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions selenoid/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,16 +644,16 @@ func (c *DockerConfigurator) Start() error {
videoConfigDir := getVolumeConfigDir(filepath.Join(c.ConfigDir, videoDirName), append(selenoidConfigDirElem, videoDirName))
logsConfigDir := getVolumeConfigDir(filepath.Join(c.ConfigDir, logsDirName), append(selenoidConfigDirElem, logsDirName))
volumes := []string{
fmt.Sprintf("%s:/etc/selenoid:ro", volumeConfigDir),
fmt.Sprintf("%s:/opt/selenoid/video", videoConfigDir),
fmt.Sprintf("%s:/opt/selenoid/logs", logsConfigDir),
fmt.Sprintf("%s:/etc/selenoid:ro,Z", volumeConfigDir),
fmt.Sprintf("%s:/opt/selenoid/video:Z", videoConfigDir),
fmt.Sprintf("%s:/opt/selenoid/logs:Z", logsConfigDir),
}
const dockerSocket = "/var/run/docker.sock"
if c.isDockerForWindows() {
//With two slashes. See https://stackoverflow.com/questions/36765138/bind-to-docker-socket-on-windows
volumes = append(volumes, fmt.Sprintf("/%s:%s", dockerSocket, dockerSocket))
} else if fileExists(dockerSocket) {
volumes = append(volumes, fmt.Sprintf("%s:%s", dockerSocket, dockerSocket))
volumes = append(volumes, fmt.Sprintf("%s:%s:Z", dockerSocket, dockerSocket))
}

cmd := []string{}
Expand Down

0 comments on commit 0bf53e0

Please sign in to comment.