For many years I have been yearning to have a single operating system that I run for all my work and leisure needs, but I have always had to run Linux for my software development related tasks, and Microsoft Windows for general usage.
Linux works well for me when doing programming work due to the powerfull bash shell, the Linux command line utilities (like git, grep, cat, etc) and how well they integrate with the shell and a host of development tools that just works so naturally in Linux, like python and node.js to name a few.
Microsoft Windows on the other hand has always had a more stable user interface for me, no issues finding drivers for hardware and compatibility with the major software which are basic necessities, like Document editors, Spreadsheet editors, Image and Video editing software or applications like Skype.
With Docker for Windows I found a solution that may work for me, I don’t really miss much of the graphicall applications of Linux, so what I really need is to be able to run the bash shell and the command line utilities from Linux.
First thing to do is to get Docker For Windows installed, note that a Windows 10 Professional is required for this. Once Docker is installed we just need to run a container of a Linux image in a detached mode and connect to the container to execute bash shell commands. In my case I just used Ubuntu’s Docker image simply for the ease of use and support around Ubuntu
Using Windows’ PowerShell I ran the following
docker run -it --rm -v C:\:/mnt/c -v D:\:/mnt/d ubuntu:latest
That will start Ubuntu in a container, then from within the container I can access both the mounted drives C: and D:;
root@883316d476da:/# ls -lh /mnt/c/
total 22G
drwxr-xr-x 2 root root 4.0K Oct 20 15:48 Documents and Settings
drwxr-xr-x 2 root root 0 Aug 16 2014 HashiCorp
drwxr-xr-x 2 root root 0 Apr 10 2013 Intel
drwxr-xr-x 2 root root 0 Apr 16 2016 OneDriveTemp
drwxr-xr-x 2 root root 0 Dec 4 21:14 PerfLogs
dr-xr-xr-x 2 root root 0 Feb 8 15:12 Program Files
dr-xr-xr-x 2 root root 0 Feb 8 14:59 Program Files (x86)
drwxr-xr-x 2 root root 0 Jan 7 15:30 ProgramData
drwxr-xr-x 2 root root 0 Apr 20 2015 Python34
drwxr-xr-x 2 root root 0 Oct 8 2014 RailsInstaller
drwxr-xr-x 2 root root 0 Oct 20 15:58 Recovery
drwxr-xr-x 2 root root 0 Oct 8 2014 Sites
drwxr-xr-x 2 root root 0 Feb 14 06:38 System Volume Information
dr-xr-xr-x 2 root root 0 Oct 20 15:48 Users
drwxr-xr-x 2 root root 0 Feb 14 17:44 Windows
drwxr-xr-x 2 root root 0 Apr 10 2017 Windows10Upgrade
drwxr-xr-x 2 root root 0 Nov 22 14:17 apps
-rwxr-xr-x 1 root root 18G Feb 14 17:45 hiberfil.sys
-rwxr-xr-x 1 root root 4.0G Feb 14 17:45 pagefile.sys
-rwxr-xr-x 1 root root 16M Feb 14 17:45 swapfile.sys
root@883316d476da:/# ls -lh /mnt/d/
total 0
drwxr-xr-x 2 root root 0 Nov 30 16:36 Downloads
dr-xr-xr-x 2 root root 0 Feb 10 07:42 Dropbox
dr-xr-xr-x 2 root root 0 Feb 15 05:12 Google Drive
drwxr-xr-x 2 root root 0 Nov 11 11:43 Hubic
drwxr-xr-x 2 root root 0 Nov 27 17:04 Photos
drwxr-xr-x 2 root root 0 Nov 11 11:20 System Volume Information
drwxr-xr-x 2 root root 0 Nov 15 16:55 backup
drwxr-xr-x 2 root root 0 Dec 19 13:57 edu
root@883316d476da:/#
so if I want to work on a NodeJS project, for example, I can work on it using an IDE like Visual Studio Code within the Windows 10 GUI;
While running commands on the Linux environment in the Ubuntu container
root@883316d476da:/# apt-get update && apt-get upgrade && apt install nodejs npm
...
....
root@883316d476da:/# cd /mnt/c/Users/Haddad/git/nilipie-api/
root@883316d476da:/# npm install
root@883316d476da:/mnt/c/Users/Haddad/git/nilipie-api# npm instal
[email protected] /mnt/c/Users/Haddad/git/nilipie-api
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
| +-- [email protected]
| `-- [email protected]
| `-- [email protected]
+-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
`-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
root@883316d476da:/mnt/c/Users/Haddad/git/nilipie-api# npm test
...
Hence using the best tools offered by both Operating Systems in a single environment.
comments powered by Disqus