|
| 1 | +# Guide to installing Docker or Docker alternatives |
| 2 | + |
| 3 | +## What is Docker? |
| 4 | + |
| 5 | +Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run. |
| 6 | + |
| 7 | +And Docker Compose is a tool for defining and running multi-container applications. It is the key to unlocking a streamlined and efficient development and deployment experience. |
| 8 | + |
| 9 | +You will see references to `docker` and `docker-compose` as you work through some of our guides and this document serves to guide anyone who needs a starting point to install that software or its alternatives. |
| 10 | + |
| 11 | +Useful links: |
| 12 | + |
| 13 | +1. [Docker Compose Overview](https://docs.docker.com/compose/) |
| 14 | +2. [Docker Overview](https://docs.docker.com/get-docker/) |
| 15 | + |
| 16 | +## Option 1: Docker Desktop |
| 17 | + |
| 18 | +**IMPORTANT NOTE**: Docker Desktop is free for small businesses (fewer than 250 employees AND less than 10 dollar million in annual revenue), personal use, education, and non-commercial open source projects. Otherwise, it requires a paid subscription |
| 19 | + |
| 20 | +Docker provides a simple and easy to use desktop platform that comes integrated with the `docker` engine as well as `docker-compose`. It is easy to use and is maintained regularly by Docker. |
| 21 | + |
| 22 | +If you have an existing subscription or if your enterprise is able to provide you with a subscription, you can follow instrutions to download and install ***Docker Desktop*** for the OS that you are working with, either [Mac](https://docs.docker.com/desktop/install/mac-install/), [Windows](https://docs.docker.com/desktop/install/windows-install/) or [Linux](https://docs.docker.com/desktop/install/linux-install/). |
| 23 | + |
| 24 | +Keep in mind that you would need to activate a subscription in case you are not eligible for the free version of Docker Desktop. |
| 25 | + |
| 26 | +## Option 2: Rancher Desktop |
| 27 | + |
| 28 | +**IMPORTANT NOTE**: Recommended for users who are new to Docker and prefer an easy one-click install of basic functionality |
| 29 | + |
| 30 | +### For Mac and Windows: |
| 31 | + |
| 32 | +Go to the Rancher Desktop [homepage](https://rancherdesktop.io/) and download the appropriate installer for your OS, then proceed to install using your respective installer file which should help install the software automatically on your machine |
| 33 | + |
| 34 | +### For Linux (non RHEL and Fedora related distributions): |
| 35 | + |
| 36 | +You can install using either the [.deb](https://docs.rancherdesktop.io/getting-started/installation/#installation-via-deb-package) or [.rpm](https://docs.rancherdesktop.io/getting-started/installation/#installation-via-deb-package) package |
| 37 | + |
| 38 | +### For Linux (RHEL and Fedora related distributions): |
| 39 | + |
| 40 | +You can install using [AppImage](https://docs.rancherdesktop.io/getting-started/installation/#installation-via-deb-package) |
| 41 | + |
| 42 | +### Verifying the install |
| 43 | + |
| 44 | +Upon completion of the install, open and start the `Rancher Desktop` program and you will see a screen with options as shown in the image. |
| 45 | + |
| 46 | +<img src="./assets/rancher_init.png" width="200" height="300"/> |
| 47 | + |
| 48 | +Here, select `dockerd` as the container engine and select `automatic` PATH configuration and click `OK` |
| 49 | + |
| 50 | +You can now verify your install. To do so: |
| 51 | + |
| 52 | +1. Close any open shell(or terminal consoles) and restart a new shell. |
| 53 | +2. Run the below command to ensure your can work with `docker` successfully. |
| 54 | + |
| 55 | +```bash |
| 56 | +docker run hello-world |
| 57 | +``` |
| 58 | + |
| 59 | + |
| 60 | +#### Useful Links: |
| 61 | + |
| 62 | +* [https://medium.com/@praveenmidde/seamlessly-switch-to-rancher-desktop-as-a-replacement-for-docker-desktop-on-mac-for-1abcf5844c4d](https://medium.com/@praveenmidde/seamlessly-switch-to-rancher-desktop-as-a-replacement-for-docker-desktop-on-mac-for-1abcf5844c4d) |
| 63 | +* [https://docs.rancherdesktop.io/getting-started/installation/](https://docs.rancherdesktop.io/getting-started/installation/) |
| 64 | + |
| 65 | + |
| 66 | +## Option 3: Podman |
| 67 | + |
| 68 | +**IMPORTANT NOTE**: For Windows and MacOS users, running Podman requires a Linux distribution/subsystem or Linux in a virtual machine |
| 69 | + |
| 70 | +Make sure to check the [prerequisites](https://podman-desktop.io/docs/podman/installing#prerequisites) before proceeding with the install. Then, |
| 71 | + |
| 72 | +1. Go to the [downloads](https://podman-desktop.io/downloads) page and download the binary suitable for your machine |
| 73 | +2. Follow the steps listed in the [procedure](https://podman-desktop.io/docs/podman/installing#procedure) section to perform the necessary checks and install podman along with other necessities. |
| 74 | + |
| 75 | +Once installed, Podman initializes a machine with standard configuration and your Podman Desktop dashboard should show `Podman is running` like below |
| 76 | + |
| 77 | +<img src="./assets/podman_machine_running.png" width="300" height="100"/> |
| 78 | + |
| 79 | +However, it is recommended to update the configurations of the machine by : |
| 80 | + |
| 81 | +* clicking on the edit button |
| 82 | +* choosing a reasonable CPU, Memory and Disk Size |
| 83 | +* click on "Update" |
| 84 | + |
| 85 | +<img src="./assets/podman_machine_edit.png" width="300" height="200"/> |
| 86 | + |
| 87 | +This will restart the machine with the updated configurations. |
| 88 | + |
| 89 | +### Install Docker and Compose Extensions |
| 90 | + |
| 91 | +Under Settings > Extensions, click on the "install" icon for the Docker and Compose extensions. Follow the prompts on the screen. |
| 92 | + |
| 93 | +<img src="./assets/podman_extensions.png" width="300" height="200"/> |
| 94 | + |
| 95 | +### Emulating Docker CLI |
| 96 | + |
| 97 | +In order to run `docker` commands using podman, you would have to follow steps as listed in the Step 1 and 3 of the [documentation](https://podman-desktop.io/docs/migrating-from-docker/emulating-docker-cli-with-podman#procedure) |
| 98 | + |
| 99 | +This creates a proxy to podman using the `docker` command on the interface and podman behind the scenes |
| 100 | + |
| 101 | +### Verifying the install |
| 102 | + |
| 103 | +You can now run the below on your terminal or console to verify the setup is working. |
| 104 | + |
| 105 | +```bash |
| 106 | +docker run hello-world |
| 107 | +``` |
| 108 | + |
| 109 | +#### Useful Links: |
| 110 | + |
| 111 | +* [https://thenewstack.io/install-and-use-podman-desktop-gui-to-manage-containers/](https://thenewstack.io/install-and-use-podman-desktop-gui-to-manage-containers/) |
| 112 | +* [https://developers.redhat.com/articles/2023/09/27/how-install-and-use-podman-desktop-windows#getting_started_with_podman_desktop](https://developers.redhat.com/articles/2023/09/27/how-install-and-use-podman-desktop-windows#getting_started_with_podman_desktop) |
| 113 | +* [https://ubuntuhandbook.org/index.php/2023/05/podman-desktop-1-0-install-in-ubuntu/](https://ubuntuhandbook.org/index.php/2023/05/podman-desktop-1-0-install-in-ubuntu/) |
| 114 | + |
| 115 | +## Option 4: Colima |
| 116 | + |
| 117 | +**IMPORTANT NOTE**: This approach requires using a CLI(Command Line Interface) and does not have a GUI. This is recommended for users who prefer a CLI-focused approach to Docker Desktop's GUI focus. |
| 118 | + |
| 119 | +[Colima](https://github.com/abiosoft/colima) is a new open-source project that bundles the container management tool [lima](https://github.com/lima-vm/lima) with a docker (linux) back-end. This is similar to what Docker Desktop actually does, but Colima and Lima are entirely open-source and just focused on running containers. They work on both `amd64` and `arm64` (M1) macs. Colima does not require installation of Docker Desktop or paying a licensing fee to Docker, Inc. |
| 120 | + |
| 121 | + |
| 122 | +### For MacOS and Linux |
| 123 | + |
| 124 | +1. First, install `homebrew` package manager by running the below command on a shell: |
| 125 | + |
| 126 | + ```shell |
| 127 | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 128 | + ``` |
| 129 | + |
| 130 | +2. Next, install `colima`, `docker` and `compose` using homebrew |
| 131 | + |
| 132 | + ```shell |
| 133 | + brew install colima |
| 134 | + brew install docker docker-compose |
| 135 | + ``` |
| 136 | +3. Start `colima` with the following command. This may take a while the first time, so wait for it to fully complete |
| 137 | + |
| 138 | + ```shell |
| 139 | + colima start |
| 140 | + ``` |
| 141 | + NOTE: The default VM created by Colima has 2 CPUs, 2GiB memory and 60GiB storage. You can customize the CPUs and Memory by instead starting `colima` and specifying the cpu and memory. For example, the below will start up colima with 4 cpu and 6GiB memory: |
| 142 | + |
| 143 | + ```shell |
| 144 | + colima start --cpu 4 --memory 6 |
| 145 | + ``` |
| 146 | + |
| 147 | + Learn more about how to customize colima from [here](https://github.com/abiosoft/colima?tab=readme-ov-file#customizing-the-vm) |
| 148 | + |
| 149 | +4. You can now verify that `docker` and `compose` can be run successfully |
| 150 | + |
| 151 | + ```shell |
| 152 | + docker run hello-world |
| 153 | + ``` |
| 154 | + |
| 155 | + ```shell |
| 156 | + docker-compose |
| 157 | + ``` |
| 158 | + |
| 159 | +#### Useful Links: |
| 160 | + |
| 161 | +* [https://smallsharpsoftwaretools.com/tutorials/use-colima-to-run-docker-containers-on-macos/](https://smallsharpsoftwaretools.com/tutorials/use-colima-to-run-docker-containers-on-macos/) |
| 162 | +* [https://www.linkedin.com/pulse/colima-better-way-run-docker-macos-linux-asutosh-pandya/](https://www.linkedin.com/pulse/colima-better-way-run-docker-macos-linux-asutosh-pandya/) |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | + |
0 commit comments