Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions docker/docker-darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

package docker

import (
"fmt"
"strings"
)

func (r *Runner) checkProjectDir() error {
if !strings.HasPrefix(r.projectDir, "/Users/") {
return fmt.Errorf("The project path must be prefixed with /Users/ on Mac OS")
}

return nil
}

func (r *Runner) canonicalProjectDir() string {
return r.projectDir
}
Expand Down
4 changes: 0 additions & 4 deletions docker/docker-linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ const (
dockerSockPath = "/var/run/docker.sock"
)

func (r *Runner) checkProjectDir() error {
return nil
}

func (r *Runner) canonicalProjectDir() string {
return r.projectDir
}
Expand Down
8 changes: 0 additions & 8 deletions docker/docker-windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ func parseWindowsPath(path string) string {
return fmt.Sprintf("/%v%v", strings.ToLower(subPaths[0]), subPaths[1])
}

func (r *Runner) checkProjectDir() error {
if !strings.HasPrefix(r.projectDir, "C:\\Users\\") {
return fmt.Errorf("The project path must be prefixed with C:\\Users\\ on Windows")
}

return nil
}

func (r *Runner) canonicalProjectDir() string {
return parseWindowsPath(r.projectDir)
}
Expand Down
20 changes: 10 additions & 10 deletions docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import (
const (
// ExecDriverName is name of exec-driver
ExecDriverName = "docker"
// DefaultSrcVolume is the default source path inside the container
DefaultSrcVolume = "/src"
// SettingName is the name of section of settings
SettingName = "docker"
// Dockerfile is default name of Dockerfile
Expand Down Expand Up @@ -362,12 +360,7 @@ func (r *Runner) push(sigCh <-chan os.Signal) error {
return nil
}

func (r *Runner) run(sigCh <-chan os.Signal) error {
err := r.checkProjectDir()
if err != nil {
return err
}

func (r *Runner) run(sigCh <-chan os.Signal) (err error) {
workDir := filepath.Join(r.SrcVolume, r.Task.Target.WorkingDir())
dockerCmd := shell.NewArgs("create",
"-v", r.canonicalProjectDir()+":"+r.SrcVolume,
Expand Down Expand Up @@ -750,7 +743,7 @@ func Factory(task *hm.Task) (hm.Runner, error) {
}

if r.SrcVolume == "" {
r.SrcVolume = DefaultSrcVolume
r.SrcVolume = task.Project().BaseDir
}
if r.ExposeDocker {
r.exposeDocker()
Expand Down Expand Up @@ -846,7 +839,14 @@ func (p *passwdPatcher) patch(r *Runner, sigCh <-chan os.Signal) (err error) {
return
}

lines = append(lines, fmt.Sprintf("user%d:x:%d:%d::/tmp:/sbin/nologin", p.uid, p.uid, p.gid))
// map current user name
var username string
if u, e := user.Current(); e == nil {
username = u.Username
} else {
username = fmt.Sprintf("user%d", p.uid)
}
lines = append(lines, fmt.Sprintf("%s:x:%d:%d::/tmp:/sbin/nologin", username, p.uid, p.gid))
content := []byte(strings.Join(lines, "\n"))

var gen bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const (
// Release is the major release version
Release = "1.3.1"
Release = "1.3.2"
// Website is the URL to project website
Website = "https://github.com/evo-cloud/hmake"

Expand Down
3 changes: 3 additions & 0 deletions site/gh-pages/content/quickguide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ docker version

and make sure it shows both client and server versions correctly.

_NOTE:_ Docker machine is no longer supported.
For Mac/Windows, please use Docker for Mac or Docker for Windows.

## Docker Compose (Optional)

Install [docker-compose](https://docs.docker.com/compose/install/) if you want to
Expand Down