tag:help.appveyor.com,2012-11-13:/discussions/questions/33953-docker-linux-containers-in-windows-docker-workersAppVeyor: Discussion 2019-07-02T21:01:03Ztag:help.appveyor.com,2012-11-13:Comment/468922742019-04-24T18:42:25Z2019-04-24T18:42:25ZDocker: Linux containers in Windows docker workers<div><p>Thanks for the coaching. I can get annoyed when people don't read the whole thing as well.</p>
<p>I'm not sure we'll be able to figure out how to adapt to not having the user directory shared, as that's the standard place for tempdir (which we share in tests), and just the natural place for everything.</p>
<p>Would it be possible to put the user directory on D?</p></div>randytag:help.appveyor.com,2012-11-13:Comment/468922742019-04-24T20:11:44Z2019-04-24T20:11:44ZDocker: Linux containers in Windows docker workers<div><p>No worries :) Try this:</p>
<pre>
<code>icacls %TMP% /grant everyone:f
mklink /J D:\user-tmp %TMP%
docker-switch-linux
docker run --rm -v D:/user-tmp:/user-tmp busybox ls /user-tmp</code>
</pre></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/468922742019-04-24T20:22:39Z2019-04-24T20:22:39ZDocker: Linux containers in Windows docker workers<div><p>I don't speak enough Windows in reality, but I think that's problematic because we use system-provided TMPDIR for tests, which is still going to be over on C: in the current situation right? So we'll be creating working repositories (in tests) in TMPDIR, and won't be able to mount them.</p>
<p>I'm pretty sure that if the homedir were on D it would all work out, not sure.</p>
<p>Alternately, if there's not a reason to avoid it, sharing C: would be natural and what most people would expect. Most people would expect both C: and D: (in this case) to be shared.</p></div>randytag:help.appveyor.com,2012-11-13:Comment/468922742019-04-24T20:38:00Z2019-04-24T20:38:00ZDocker: Linux containers in Windows docker workers<div><p>Yeah, we will consider sharing C as well. For now I still believe junction should work fro you. You can do <code>mklink /J D:\<any_folder_on_D> <any_folder_on_C></code> and then use that <code>D:\<any_folder_on_D></code> as a docker volume</p>
<p>But because share credentials are done with separate user (not <code>appveyor</code> under which build is running) you might need to change ACLs if (see <code>icacls</code> in sample) if this folder happens to be inside the <code>appveyor</code> user folder.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/468922742019-04-24T21:17:42Z2019-04-24T21:17:42ZDocker: Linux containers in Windows docker workers<div><p>But... <code>C:\Users\testbot>echo %TEMP% C:\Users\testbot\AppData\Local\Temp</code></p>
<p>Doesn't that mean I'm going to end up creating directories in AppData\Local\Temp and not being able to mount them?</p></div>randytag:help.appveyor.com,2012-11-13:Comment/468922742019-04-24T21:22:11Z2019-04-24T21:22:11ZDocker: Linux containers in Windows docker workers<div><p>Please replace <code>TMP</code> with <code>TEMP</code> in the example I sent and try. I believe it should work for you.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/468922742019-04-30T16:46:25Z2019-04-30T16:46:25ZDocker: Linux containers in Windows docker workers<div><p>Just a note that I haven't been successful with this yet, but probably haven't given it enough effort. The simple changes suggested did not get things happening on the D: drive. I'm pretty sure that if you end up moving the homedir to D: things will be OK, and absolutely certain that if you share the C: drive it will be OK. Or give us the option to change the shares.</p></div>randytag:help.appveyor.com,2012-11-13:Comment/468922742019-05-02T00:08:53Z2019-05-02T00:08:53ZDocker: Linux containers in Windows docker workers<div><p>I did some testing on a local WIndows 10 machine with 2 drives, and do not believe this strategy works. If you use <code>mklink /J</code> to create a shadow directory, Windows still knows where it really is, and docker still cares that the real thing isn't shared.</p>
<pre>
<code>F:\Users>dir
Volume in drive F is New Volume
Volume Serial Number is 84D6-41DB
Directory of F:\Users
05/01/2019 05:40 PM <DIR> .
05/01/2019 05:40 PM <DIR> ..
05/01/2019 05:40 PM <JUNCTION> rfay [c:\Users\rfay]</code>
</pre></div>randytag:help.appveyor.com,2012-11-13:Comment/468922742019-05-02T01:44:42Z2019-05-02T01:44:42ZDocker: Linux containers in Windows docker workers<div><p>OK, <a href="https://github.com/appveyor/ci/blob/master/scripts/docker-appveyor.psm1">here</a> is the way we do this (admittedly quite hacky). I think you can figure out how to deal with C: the same way :)</p></div>Ilya Finkelshteyn