Skip to content

Instantly share code, notes, and snippets.

@szanata
Last active April 22, 2019 21:29
Show Gist options
  • Save szanata/d7ee803055de9fd274b9a6e08f09c54f to your computer and use it in GitHub Desktop.
Save szanata/d7ee803055de9fd274b9a6e08f09c54f to your computer and use it in GitHub Desktop.
Create docker alpine on windows and avoid errors of synchronization on the volumes IO
echo "Starting docker"
:: Some references
:: https://github.com/docker/for-win/issues/969
:: https://forums.docker.com/t/volume-mounts-in-windows-does-not-work/10693/25
set /p PWD="Enter your user password: "
DOMAIN="your compute name"
USERNAME="your username"
docker volume create ^
--driver local ^
--opt type=cifs ^
--opt device=//10.0.75.1/D/my/path/ ^
--opt o=rw,relatime,vers=2.0,sec=ntlmsspi,cache=strict,username=%USERNAME%,pass=%PWD%,domain=%DOMAIN%,uid=0,noforceuid,gid=0,noforcegid,addr=10.0.75.1,file_mode=0755,dir_mode=0777,iocharset=utf8,nounix,serverino,mapposix,nobrl,mfsymlinks,noperm,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1 ^
shared_volume
:: Copy this "o=" from the output of the "mount" command inside your alpine container
:: Add "pass=" property, this will be your windows password, in this bat, this is a input
docker run -it --rm --platform linux ^
-v shared_volume:/app ^
-w /app/ ^
node:11.6-alpine sh
@szanata
Copy link
Author

szanata commented Apr 5, 2019

Creating/running you container with this external volume you can run npm install scss and it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment