Skip to content

Commit 7e3f048

Browse files
committed
[windows] Improve documentation about the Windows backend
1 parent 758056c commit 7e3f048

File tree

4 files changed

+406
-122
lines changed

4 files changed

+406
-122
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ in progress
1818
- Add support for Windows Server Core 2016, 2022 and friends, like
1919
``windows/servercore:ltsc2016``, ``windows/servercore:ltsc2022``, or
2020
``windows/nanoserver:ltsc2022``.
21+
- Improve documentation about the Windows backend
2122

2223
2022-05-20 0.2.0
2324
================

README.rst

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ Racker
224224
The ``racker`` program aims to resemble the semantics of Docker by providing a
225225
command line interface compatible with the ``docker`` command.
226226

227-
Linux examples::
227+
Linux
228+
-----
229+
::
228230

229231
# Invoke the vanilla Docker `hello-world` image.
230232
# FIXME: Does not work yet.
@@ -256,47 +258,19 @@ Linux examples::
256258
time echo "hello world" | racker run -it --rm fedora:37 cat /dev/stdin > hello
257259
cat hello
258260

259-
Windows examples::
260-
261-
# Windows OS images, mostly LTSC (Long-Term Servicing Channel).
262-
# Please note the download sizes.
263-
# Nanoserver: 250 MB, Servercore: 6 GB, Servercore with Java: 7 GB, Windows: 15 GB
264-
265-
# Launch an interactive command prompt (cmd, PowerShell or Bash).
266-
racker --verbose run -it --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2016-amd64 cmd
267-
racker --verbose run -it --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2019-amd64 powershell
268-
racker --verbose run -it --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2022-amd64 bash
269-
270-
# Launch a single command.
271-
racker --verbose run --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2019-amd64 -- 'powershell -Command {echo "Hello, world."}'
272-
racker --verbose run --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2019-amd64 'sh -c "echo Hello, world."'
273-
274-
# Inquire system information.
275-
racker run --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2019-amd64 wmic os get caption
276-
racker run --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2019-amd64 'powershell -Command Get-ComputerInfo'
277-
278-
# Use stdin and stdout, with time keeping.
279-
time racker --verbose run --rm --platform=windows/amd64 mcr.microsoft.com/windows/nanoserver:1809-amd64 cmd /C echo "Hello, world." > hello
280-
cat hello
261+
Windows
262+
-------
281263

282-
# Invoke a Java command prompt (JShell) with different Java versions.
283-
racker run -it --rm --platform=windows/amd64 openjdk:18-windowsservercore-1809 jshell
284-
racker run -it --rm --platform=windows/amd64 openjdk:19-windowsservercore-ltsc2022 jshell
285-
racker run -it --rm --platform=windows/amd64 eclipse-temurin:18-jdk jshell
286-
System.out.println("OS: " + System.getProperty("os.name") + ", version " + System.getProperty("os.version"))
287-
System.out.println("Java: " + System.getProperty("java.vendor") + ", version " + System.getProperty("java.version"))
288-
/exit
264+
An example of a basic command line invocation should get you started,
265+
especially if you are familiar with the ``docker`` command::
289266

290-
# Windows Nano Server.
291-
racker --verbose run -it --rm --platform=windows/amd64 mcr.microsoft.com/windows/nanoserver:1809-amd64 cmd
292-
racker --verbose run --rm --platform=windows/amd64 mcr.microsoft.com/windows/nanoserver:1809-amd64 cmd /C echo Hello, world.
293-
racker --verbose run --rm --platform=windows/amd64 mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64 cmd /C echo Hello, world.
294-
racker --verbose run -it --rm --platform=windows/amd64 mcr.microsoft.com/powershell:nanoserver-ltsc2022 pwsh
267+
racker --verbose run --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2022 -- wmic os get caption
295268

296-
# Full Windows.
297-
racker --verbose run -it --rm --platform=windows/amd64 mcr.microsoft.com/windows:1809-amd64 cmd
298-
racker --verbose run -it --rm --platform=windows/amd64 mcr.microsoft.com/windows:ltsc2022-amd64 cmd
269+
Caption
270+
Microsoft Windows Server 2022 Datacenter
299271

272+
More extensive information, including many examples, can be found at the
273+
`Racker Windows backend`_ documentation.
300274

301275

302276
Postroj
@@ -483,6 +457,7 @@ Troubleshooting
483457
.. _Packer: https://www.packer.io/
484458
.. _Podman: https://podman.io/
485459
.. _Racker sandbox installation: https://github.com/cicerops/racker/blob/main/doc/sandbox.rst
460+
.. _Racker Windows backend: https://github.com/cicerops/racker/blob/main/doc/winrunner.rst
486461
.. _skopeo: https://github.com/containers/skopeo
487462
.. _systemd: https://www.freedesktop.org/wiki/Software/systemd/
488463
.. _systemd-nspawn: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

doc/cratedb.rst

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,27 @@
22
Using Racker and Postroj for CrateDB CI
33
#######################################
44

5-
.. note::
6-
7-
This is still a work in progress.
8-
9-
10-
*************
11-
Prerequisites
12-
*************
13-
14-
When creating the "Windows Docker Machine" virtual machine, the program will
15-
configure it to use 6 VPUs and 6144 MB system memory.
16-
17-
In order to adjust those values, use these environment variables before
18-
invoking the later commands::
19-
20-
export RACKER_VM_VCPUS=12
21-
export RACKER_VM_MEMORY=8192
22-
23-
If you want to adjust the values after the initial deployment, you will have to
24-
reset the "Windows Docker Machine" installation directory. For example, it is:
25-
26-
- On Linux: ``/root/.local/state/racker/windows-docker-machine``
27-
- On macOS: ``/Users/amo/Library/Application Support/racker/windows-docker-machine``
28-
29-
305

316
**********
327
racker run
338
**********
349

3510
Purpose: Invoke programs in a Java/OpenJDK environment, within a
36-
virtualized/dockerized Windows installation.
11+
virtualized/dockerized, volatile/ephemeral Windows environment.
3712

3813
Run the CrateDB test suite on OpenJDK 18 (Eclipse Temurin)::
3914

40-
time racker run --rm --platform=windows/amd64 eclipse-temurin:18-jdk \
15+
time racker --verbose run --rm --platform=windows/amd64 eclipse-temurin:18-jdk \
4116
"sh -c 'mkdir /c/src; cd /c/src; git clone https://github.com/crate/crate --depth=1; cd crate; ./gradlew --no-daemon --parallel -PtestForks=2 :server:test -Dtests.crate.run-windows-incompatible=false --stacktrace'"
4217

18+
Use the same image, but select a specific operating system version::
19+
20+
export RACKER_VM_BOX=2019-box
21+
racker --verbose run --rm --platform=windows/amd64 eclipse-temurin:18-jdk -- wmic os get caption
22+
4323
Invoke a Java command prompt (JShell) with OpenJDK 18::
4424

45-
racker run -it --rm --platform=windows/amd64 eclipse-temurin:18-jdk jshell
25+
racker --verbose run -it --rm --platform=windows/amd64 eclipse-temurin:18-jdk jshell
4626
System.out.println("OS: " + System.getProperty("os.name") + ", version " + System.getProperty("os.version"))
4727
System.out.println("Java: " + System.getProperty("java.vendor") + ", version " + System.getProperty("java.version"))
4828

0 commit comments

Comments
 (0)