From c838c3e637efdbcafd5ad1b6d7c7f1f965d1529a Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Fri, 5 Feb 2021 07:53:03 -0500 Subject: [PATCH] Re-enable access to command history (#184) - Set the home folder on the mounted volume DT-3737 - Fix a bug to handle --docker-arg correctly DT-3738 - Update dependencies --- docker.go | 7 ++++--- go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docker.go b/docker.go index 8444481b..56df308c 100644 --- a/docker.go +++ b/docker.go @@ -103,8 +103,8 @@ func (docker *dockerConfig) call() int { dockerArgs = append(dockerArgs, fmt.Sprintf("--user=%s:%s", currentUser.Uid, currentUser.Gid)) } + currentUser := must(user.Current()).(*user.User) if app.MountHomeDir { - currentUser := must(user.Current()).(*user.User) home := filepath.ToSlash(currentUser.HomeDir) mountingHome := fmt.Sprintf("/home/%s", filepath.Base(home)) @@ -112,9 +112,10 @@ func (docker *dockerConfig) call() int { "-v", fmt.Sprintf("%v:%v", convertDrive(home), mountingHome), "-e", fmt.Sprintf("HOME=%v", mountingHome), }...) - - dockerArgs = append(dockerArgs, config.DockerOptions...) + } else { + dockerArgs = append(dockerArgs, "-e", fmt.Sprintf("HOME=%s/home/%s", dockerMountImagePath, currentUser.Username)) } + dockerArgs = append(dockerArgs, config.DockerOptions...) switch app.TempDirMountLocation { case mountLocHost: diff --git a/go.mod b/go.mod index 2ad5d29e..79c87931 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,14 @@ go 1.13 require ( github.com/Microsoft/go-winio v0.4.16 // indirect - github.com/aws/aws-sdk-go v1.37.0 + github.com/aws/aws-sdk-go v1.37.5 github.com/blang/semver v3.5.1+incompatible github.com/containerd/containerd v1.4.3 // indirect github.com/coveooss/gotemplate/v3 v3.6.1 github.com/coveooss/multilogger v0.5.2 github.com/coveord/kingpin/v2 v2.4.0 github.com/docker/distribution v2.7.1+incompatible // indirect - github.com/docker/docker v20.10.2+incompatible + github.com/docker/docker v20.10.3+incompatible github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect github.com/fatih/color v1.10.0 diff --git a/go.sum b/go.sum index e33f829c..53386fa1 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.37.0 h1:GzFnhOIsrGyQ69s7VgqtrG2BG8v7X7vwB3Xpbd/DBBk= -github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.37.5 h1:9zJ1aXRk1gLSWEeaMXa7Hbv1pIM915T2tpaIJi0+mkA= +github.com/aws/aws-sdk-go v1.37.5/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= @@ -68,8 +68,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.2+incompatible h1:vFgEHPqWBTp4pTjdLwjAA4bSo3gvIGOYwuJTlEjVBCw= -github.com/docker/docker v20.10.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.3+incompatible h1:+HS4XO73J41FpA260ztGujJ+0WibrA2TPJEnWNSyGNE= +github.com/docker/docker v20.10.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=