|
| 1 | +# WSL Docker Hub CLI |
| 2 | +A utility for deploying images from Docker Hub to WSL. |
| 3 | + |
| 4 | +# Requirements |
| 5 | +- Windows 10/11 |
| 6 | +- Windows Subsystem for Linux ([ Click me to install :) ](https://www.microsoft.com/store/productId/9P9TQF7MRM4R)) |
| 7 | + |
| 8 | +# Get Started |
| 9 | +1. Pick the system image you want on [Docker Hub](https://hub.docker.com/search?q=). |
| 10 | +2. Run `wsldh install <ImageName>:<Tag> --name <CustomName> --dir <InstallDir>` to install. |
| 11 | + |
| 12 | +# Example |
| 13 | +## Install the latest version of Debian |
| 14 | +> Install to `D:\WSL\Debian` and name to `Debian-Latest` |
| 15 | +
|
| 16 | +Run |
| 17 | +`wsldh install debian:latest --dir D:\WSL\Debian --name Debian-Latest` |
| 18 | +Or |
| 19 | +`wsldh i debian:latest -d D:\WSL\Debian -n Debian-Latest` |
| 20 | + |
| 21 | +## Install the specific version of Debian |
| 22 | +> Install Debian 8 (jessie) to `D:\WSL\Debian Jessie` and name to `Debian-8` |
| 23 | +
|
| 24 | +Run |
| 25 | +`wsldh install debian:jessie --dir "D:\WSL\Debian Jessie" --name Debian-8` |
| 26 | +Or |
| 27 | +`wsldh i debian:jessie -d "D:\WSL\Debian Jessie" -n Debian-8` |
| 28 | + |
| 29 | +# Features |
| 30 | +- Use filters to select images. |
| 31 | +- Download Docker image(s) from Docker Hub Registry. (without install) |
| 32 | +- Install a Docker image to WSL form Docker Hub Registry. |
| 33 | +- Export WSL rootfs (.tar) or Docker image (.tar.gz) form WSL. |
| 34 | +- Simply management of WSL. |
| 35 | + |
| 36 | +# Usage |
| 37 | +``` |
| 38 | +Commands: |
| 39 | +
|
| 40 | + help, h |
| 41 | + Display this help. |
| 42 | +
|
| 43 | + download, dl |
| 44 | + Download Docker image(s) from Docker Hub Registry |
| 45 | +
|
| 46 | + Usage: wsldh download <image><:tag|@digest> [options] [filters] |
| 47 | + |
| 48 | + Example: |
| 49 | + wsldh download ubuntu:latest --output .\output\ |
| 50 | + wsldh download ubuntu@sha256:965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea --output .\output\ |
| 51 | +
|
| 52 | + Options: |
| 53 | + --output, -o <path> |
| 54 | + (Required) Output directory. |
| 55 | + --all, -a |
| 56 | + Download all selected images. (default: download first image only) |
| 57 | +
|
| 58 | + Filters: |
| 59 | + --os <os> |
| 60 | + Operating system filter. (eg: linux) |
| 61 | + --arch <arch> |
| 62 | + CPU architecture filter. (eg: arm64) |
| 63 | + --variant <variant> |
| 64 | + CPU variant filter. (eg: v8) |
| 65 | +
|
| 66 | + install, i |
| 67 | + Install a Docker image to WSL form Docker Hub Registry. |
| 68 | +
|
| 69 | + Usage: wsldh install <image><:tag|@digest> [options] [filters] |
| 70 | +
|
| 71 | + Example: |
| 72 | + wsldh install ubuntu:latest --name Ubuntu-Latest --dir .\WSLRootFS\Ubuntu\ |
| 73 | + wsldh install ubuntu@sha256:965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea --name Ubuntu-Latest --dir .\WSLRootFS\Ubuntu\ |
| 74 | +
|
| 75 | + Options: |
| 76 | + --name, -n <name> |
| 77 | + (Required) Custom linux distribution name. |
| 78 | + --dir, -d <path> |
| 79 | + (Required) Linux rootfs install location. |
| 80 | +
|
| 81 | + Filters: |
| 82 | + --os <os> |
| 83 | + Operating system filter. (eg: linux) |
| 84 | + --arch <arch> |
| 85 | + CPU architecture filter. (eg: arm64) |
| 86 | + --variant <variant> |
| 87 | + CPU variant filter. (eg: v8) |
| 88 | +
|
| 89 | + export |
| 90 | + Export WSL rootfs (.tar) or Docker image (.tar.gz) form WSL. |
| 91 | +
|
| 92 | + Usage: wsldh export <distribution name> [options] |
| 93 | +
|
| 94 | + Example: |
| 95 | + wsldh export Ubuntu-Latest --output .\output\ubuntu.tar.gz --compress |
| 96 | +
|
| 97 | + Options: |
| 98 | + --output, -o <path> |
| 99 | + (Required) Output file path. |
| 100 | + --compress, -c |
| 101 | + Use GZip to compress. |
| 102 | +
|
| 103 | + list, ls |
| 104 | + List all installed distribution of WSL. |
| 105 | +
|
| 106 | + remove, rm |
| 107 | + Remove a distribution from WSL. |
| 108 | +
|
| 109 | + Usage: wsldh remove <distribution name> |
| 110 | +
|
| 111 | + Example: |
| 112 | + wsldh remove Ubuntu-Latest |
| 113 | +``` |
0 commit comments