dockerfiles-windows icon indicating copy to clipboard operation
dockerfiles-windows copied to clipboard

G:\ workaround no longer working in nano (no longer admin) - ES image

Open marcanpilami opened this issue 7 years ago • 1 comments

Hi,

in the latest versions of nano, such as microsoft/nanoserver:1709 and Microsoft/powershell:nanoserver the account used by Docker is no longer admin. So it is not possible to modify HKLM anymore, and therefore not possible to create the G: alias.

My attempts are with the ElasticSearch image (my actual goal is to create a 1709 image of Nexus, which uses Elasticsearch, so I start with your dockerfile - but in all cases, your dockerfile will no longer work as soon as the OpenJDK project updates its nano image).

I have tried to map the G: drive in the the Dockerfile (VOLUME G:) - it actually works, but ES still exploses on sun.nio.fs.WindowsLinkSupport.getFinalPath as was the case before your hack came up. So I guess it is not a "true" fixed drive - [System.IO.DriveInfo]::getdrives() reports it as a network drive, which is quite surprising.

I have also tried to find a non-admin way of creating the alias, to no avail (no corresponding key in HKCU, no subst command in nano that could be run on each startup...). Also, haven't tried, copy subst.exe into the image and run it before the start command... would be a license issue anyway.

The only way I currently see is to docker exec into the image, make the change and commit to create an image from the container... (docker container exec -i -t -u ContainerAdministrator xxxxx cmd /C REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices" /v "G:" /t REG_SZ /d '\??\C:\data') Truly ugly, but it works OK. I'm however looking for a pure Dockerfile solution.

Would you have a workaround for the workaround?

Thanks, Marc

marcanpilami avatar Dec 29 '17 09:12 marcanpilami

If you use 1803 instead, the mounts no longer appear as shortcuts, but as normal directories, making the G: alias unncessary

richardgavel avatar Nov 08 '18 03:11 richardgavel