Skip to content

Commit

Permalink
use empytDir rather then hostPath
Browse files Browse the repository at this point in the history
On remote cluster or in cloud it can  be tricky to get hostPath working
as expected by compose
  • Loading branch information
kadel committed Jul 21, 2016
1 parent 03877df commit a97b413
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cli/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,6 @@ func configVolumes(service ServiceConfig) ([]api.VolumeMount, []api.Volume) {
for _, volume := range service.Volumes {
character := ":"
if strings.Contains(volume, character) {
hostDir := volume[0:strings.Index(volume, character)]
hostDir = strings.TrimSpace(hostDir)
containerDir := volume[strings.Index(volume, character)+1:]
containerDir = strings.TrimSpace(containerDir)

Expand All @@ -472,11 +470,10 @@ func configVolumes(service ServiceConfig) ([]api.VolumeMount, []api.Volume) {
volumeName := RandStringBytes(20)

volumesMount = append(volumesMount, api.VolumeMount{Name: volumeName, ReadOnly: readonly, MountPath: containerDir})
p := &api.HostPathVolumeSource{
Path: hostDir,
}
//p.Path = hostDir
volumeSource := api.VolumeSource{HostPath: p}

emptyDir := &api.EmptyDirVolumeSource{}
volumeSource := api.VolumeSource{EmptyDir: emptyDir}

volumes = append(volumes, api.Volume{Name: volumeName, VolumeSource: volumeSource})
}
}
Expand Down

0 comments on commit a97b413

Please sign in to comment.