michelou / docker-examples

Playing with Docker on Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playing with Docker on Windows

Docker project This repository gathers Docker code examples coming from various websites and books.
It also includes several batch files for experimenting with Docker on the Windows machine.

Ada, Akka, C++, Dart, Deno, Flix, Golang, GraalVM, Haskell, Kafka, Kotlin, LLVM, Modula-2, Node.js, Rust, Scala 3, Spark, Spring, TruffleSqueak and WiX Toolset are other trending topics we are continuously monitoring.

Project dependencies

Optionally one may also install the following software:

🔎 Git for Windows provides a BASH emulation used to run git from the command line (as well as over 250 Unix commands like awk, diff, file, grep, more, mv, rmdir, sed and wc). For instance our development environment looks as follows (February 2024) 1:

C:\opt\Git\                (366 MB)
C:\opt\VSCode\             (341 MB)
C:\Program Files\Docker\   (2.8 GB)

Directory structure

This project is organized as follows:

bin\
docs\
examples\{README.md}
README.md
RESOURCES.md
setenv.bat

where

We also define a virtual drive – e.g. drive O: – in our working environment in order to reduce/hide the real path of our project directory (see article "Windows command prompt limitation" from Microsoft Support).

🔎 We use the Windows external command subst to create virtual drives; for instance:

> subst O: %USERPROFILE%\workspace\docker-examples

In the next section we give a brief description of the batch files present in this project.

Batch commands

We execute command setenv.bat once to setup our development environment; it makes external tools such as docker.exe, git.exe, and sh.exe directly available from the command prompt.

> setenv -verbose
Tool versions:
   docker 25.0.2,
   git 2.43.0.windows.1, diff 3.10, bash 5.2.21(1)-release
Tool paths:
   C:\Program Files\Docker\Docker\resources\bin\docker.exe
   C:\opt\Git\bin\git.exe
   C:\opt\Git\usr\bin\diff.exe
   C:\opt\Git\bin\bash.exe
Environment variables:
   "DOCKER_HOME=C:\Program Files\Docker\Docker\"
   "GIT_HOME=C:\opt\Git"
Path associations:
   O:\: => C:\Users\michelou\workspace-perso\docker-examples\

> where docker git sh
C:\Program Files\Docker\Docker\resources\bin\docker
C:\Program Files\Docker\Docker\resources\bin\docker.exe
C:\opt\deno\deno.exe
C:\opt\Git\bin\git.exe
C:\opt\Git\mingw64\bin\git.exe
C:\opt\Git\bin\sh.exe
C:\opt\Git\usr\bin\sh.exe

Footnotes

[1] Downloads

In our case we downloaded the following installation files (see section 1):
Docker Desktop Installer.exe      (481 MB)
PortableGit-2.43.0-64-bit.7z.exe  ( 41 MB)

mics/February 2024  

About

Playing with Docker on Windows