fix use of container v2

Change-Id: I94c50e5989ad81b8d1dd6e8c162dd50ed5ee880a
diff --git a/src/com/mirantis/mk/Debian.groovy b/src/com/mirantis/mk/Debian.groovy
index 6c12211..11b8f2d 100644
--- a/src/com/mirantis/mk/Debian.groovy
+++ b/src/com/mirantis/mk/Debian.groovy
@@ -32,8 +32,8 @@
     def img = dockerLib.getImage("tcpcloud/debian-build-${os}-${dist}", image)
     def workspace = common.getWorkspace()
 
-    img.inside("-v ${workspace}:${workspace} -w ${workspace} -u root:root" ) {
-        sh("""which eatmydata || (apt-get update && apt-get install -y eatmydata) &&
+    img.inside("-v ${workspace}:${workspace} -u root:root" ) {
+        sh("""cd ${workspace} && (which eatmydata || (apt-get update && apt-get install -y eatmydata)) &&
             export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH:+"\$LD_LIBRARY_PATH:"}/usr/lib/libeatmydata &&
             export LD_PRELOAD=\${LD_PRELOAD:+"\$LD_PRELOAD "}libeatmydata.so &&
             [[ -z "${extraRepoUrl}" && "${extraRepoUrl}" != "null" ]] || echo "${extraRepoUrl}" >/etc/apt/sources.list.d/extra.list &&
@@ -91,8 +91,8 @@
     def img = dockerLib.getImage("tcpcloud/debian-build-${os}-${dist}", image)
     def workspace = common.getWorkspace()
 
-    img.inside("-v ${workspace}:${workspace} -w ${workspace} -u root:root" ) {
-        sh("""apt-get update && apt-get install -y build-essential devscripts &&
+    img.inside("-v ${workspace}:${workspace} -u root:root" ) {
+        sh("""cd ${workspace} && apt-get update && apt-get install -y build-essential devscripts &&
         cd ${dir} && uscan --download-current-version &&
         dpkg-buildpackage -S -nc -uc -us""")
     }
@@ -121,10 +121,10 @@
     def dist = imageArray[1]
     def img = dockerLib.getImage("tcpcloud/debian-build-${os}-${dist}", image)
 
-    img.inside("-v ${workspace}:${workspace} -w ${workspace} -u root:root") {
+    img.inside("-v ${workspace}:${workspace} -u root:root") {
 
         withEnv(["DEBIAN_FRONTEND=noninteractive", "DEBFULLNAME='${gitName}'", "DEBEMAIL='${gitEmail}'"]) {
-            sh("""which eatmydata || (apt-get update && apt-get install -y eatmydata) &&
+            sh("""cd ${workspace} && (which eatmydata || (apt-get update && apt-get install -y eatmydata)) &&
             export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH:+"\$LD_LIBRARY_PATH:"}/usr/lib/libeatmydata &&
             export LD_PRELOAD=\${LD_PRELOAD:+"\$LD_PRELOAD "}libeatmydata.so &&
             apt-get update && apt-get install -y build-essential git-buildpackage dpkg-dev sudo &&
@@ -173,8 +173,8 @@
     def os = imageArray[0]
     def dist = imageArray[1]
     def img = dockerLib.getImage("tcpcloud/debian-build-${os}-${dist}", image)
-    img.inside("-v ${workspace}:${workspace} -w ${workspace} -u root:root") {
-        sh("""apt-get update && apt-get install -y lintian &&
+    img.inside("-v ${workspace}:${workspace} -u root:root") {
+        sh("""cd ${workspace} && apt-get update && apt-get install -y lintian &&
             lintian -Ii -E --pedantic --profile=${profile} ${changes}""")
     }
 }