From 475d5d2d938a1148ee9ccef5815a7514432a854f Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Fri, 9 Feb 2024 14:26:44 -0600 Subject: [PATCH 01/17] Add Colima installation over Docker Desktop Since our suggested containerization tool is Colima it makes sense to update the development guide to reflect this and remove the Docker installation steps. --- dev_envs/mac-env-setup.md | 107 +++++++++++++++++++++++++++++++++++--- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 0ca6490..a7b786a 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -43,12 +43,6 @@ sudo xcodebuild -license xcode-select --install ``` -### Docker ### - -Download the latest stable [Docker for Mac](https://www.docker.com/docker-mac). -Install it by double-clicking the downloaded `dmg` file and dragging the -Docker application file to the `Applications` folder. - ### iTerm2 (recommended) ### To set up iTerm2 - a macOS terminal replacement with some nifty features - @@ -106,6 +100,107 @@ After installing Brew, you'll want to install other useful packages. We recommend installing all the packages specified in the [CISA `laptop` script repository](https://github.com/cisagov/laptop/blob/master/Brewfile). +### Colima (Docker alternative) ### + +Since [Docker](https://www.docker.com/pricing/faq/) comes with licensing +conditions that might not be suitable for everyone, including certain +individuals or businesses. For those looking to operate containers on a Mac +or Linux, [Colima](https://github.com/abiosoft/colima) is our suggested +alternative. It is an open-source container runtime that is easy to set +up and compatible with both MacOS and Linux systems. It leverages the +power of Docker as its container runtime, enabling users to utilize +Docker commands directly within a terminal without needing a full +Docker Desktop installation. + +#### Installing Colima #### + +Before installing Colima, you’ll want to remove the Docker Desktop app +from your system if you have it installed. + +Then run the following commands: + +```console +brew install colima +brew install docker docker-compose +``` + +After the installation you will want to run the following to verify the +a successful installation. + +```console +colima start +``` + +Running this will initialize the Docker Daemon within a lightweight Linux +virtual machine on your system and might take some time. When it finishes +you can confirm that Docker is working by running: + +```console +docker +``` + +Afterwards you should see the `docker` usage menu. Next confirm that +`docker-compose` is working by running: + +```console +docker-compose +``` + +Like the previous command you should be prompted with the `docker-compose` +usage menu. + +#### Additional Colima configurations (optional, but strongly encouraged) #### + +The following Colima configurations come from this [tutorial](https://smallsharpsoftwaretools.com/tutorials/use-colima-to-run-docker-containers-on-macos/). + +To configure docker-compose as a Docker plugin so you can use docker compose +as a command instead of the legacy docker-compose script. First, create a +folder in your home directory to hold Docker CLI plugins: + +```console +mkdir -p ~/.docker/cli-plugins +``` + +Then symlink the docker-compose command into that new folder: + +```console +ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose +``` + +Run docker compose: + +```console +docker compose +``` + +Ensure that you see the `docker-compose` usage menu. + +You’ll also need Buildx to build some Docker containers. This is installed +with Docker Engine on macOS, but you can install this with Homebrew: + +```console +brew install docker-Buildx +``` + +Once downloaded, symlink it to the cli-plugins folder: + +```console +ln -sfn $(brew --prefix)/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx +``` + +To create a VM with four CPUs, 4GB of memory, and 100GiB of disk space, +follow these options: + +```console +colima stop +``` + +Wait for Colima to shutdown the VM. Then restart it with: + +```console +colima start --cpu 4 --memory 4 --disk 100 +``` + ### Environment configuration ### For portability between computers and environments, you may want to switch From 52d7fc7a2727d7197dafaf1024092f8d78178654 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Fri, 9 Feb 2024 14:49:37 -0600 Subject: [PATCH 02/17] Fix grammar and add backticks to inline code --- dev_envs/mac-env-setup.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index a7b786a..ee46aa1 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -124,7 +124,7 @@ brew install colima brew install docker docker-compose ``` -After the installation you will want to run the following to verify the +After the installation you will want to run the following to verify a successful installation. ```console @@ -153,9 +153,10 @@ usage menu. The following Colima configurations come from this [tutorial](https://smallsharpsoftwaretools.com/tutorials/use-colima-to-run-docker-containers-on-macos/). -To configure docker-compose as a Docker plugin so you can use docker compose -as a command instead of the legacy docker-compose script. First, create a -folder in your home directory to hold Docker CLI plugins: +To configure `docker-compose` as a Docker plugin so you can use +`docker compose` as a command instead of the legacy `docker-compose` +script. First, create a folder in your home directory to hold +Docker CLI plugins: ```console mkdir -p ~/.docker/cli-plugins From 354c576282294bc12041dedc3f3816c19db87704 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Sat, 10 Feb 2024 16:29:56 -0600 Subject: [PATCH 03/17] Make the instructions more clear and concise --- dev_envs/mac-env-setup.md | 150 ++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 72 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index ee46aa1..78ec305 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -100,107 +100,113 @@ After installing Brew, you'll want to install other useful packages. We recommend installing all the packages specified in the [CISA `laptop` script repository](https://github.com/cisagov/laptop/blob/master/Brewfile). -### Colima (Docker alternative) ### - -Since [Docker](https://www.docker.com/pricing/faq/) comes with licensing -conditions that might not be suitable for everyone, including certain -individuals or businesses. For those looking to operate containers on a Mac -or Linux, [Colima](https://github.com/abiosoft/colima) is our suggested -alternative. It is an open-source container runtime that is easy to set -up and compatible with both MacOS and Linux systems. It leverages the -power of Docker as its container runtime, enabling users to utilize -Docker commands directly within a terminal without needing a full -Docker Desktop installation. +### Colima: A Docker Alternative ### + +For individuals or businesses seeking a container solution without +the licensing conditions associated with [Docker](https://www.docker.com/pricing/faq/) +, [Colima](https://github.com/abiosoft/colima) offers a compelling +open-source alternative. Compatible with both MacOS and Linux, +Colima facilitates running containers directly using Docker +commands without the need for Docker Desktop. #### Installing Colima #### -Before installing Colima, you’ll want to remove the Docker Desktop app -from your system if you have it installed. +**Prerequisites:** If Docker Desktop is installed on your system, +uninstall it before proceeding. -Then run the following commands: +**Installation Steps:** -```console -brew install colima -brew install docker docker-compose -``` +1. Install Colima and Docker + command-line tools using Homebrew: -After the installation you will want to run the following to verify -a successful installation. + ```console + brew install colima docker docker-compose + ``` -```console -colima start -``` +1. Verify the installation by starting Colima: -Running this will initialize the Docker Daemon within a lightweight Linux -virtual machine on your system and might take some time. When it finishes -you can confirm that Docker is working by running: + ```console + colima start + ``` -```console -docker -``` + This initializes the Docker Daemon within a lightweight VM. + The first startup may take a moment. -Afterwards you should see the `docker` usage menu. Next confirm that -`docker-compose` is working by running: +1. Confirm Docker is operational: -```console -docker-compose -``` + ```console + docker + ``` -Like the previous command you should be prompted with the `docker-compose` -usage menu. + You should see the Docker usage menu. -#### Additional Colima configurations (optional, but strongly encouraged) #### +1. Verify `docker-compose` is working: -The following Colima configurations come from this [tutorial](https://smallsharpsoftwaretools.com/tutorials/use-colima-to-run-docker-containers-on-macos/). + ```console + docker-compose + ``` -To configure `docker-compose` as a Docker plugin so you can use -`docker compose` as a command instead of the legacy `docker-compose` -script. First, create a folder in your home directory to hold -Docker CLI plugins: + The `docker-compose` usage menu should appear. -```console -mkdir -p ~/.docker/cli-plugins -``` +### Optional Configurations ### -Then symlink the docker-compose command into that new folder: +Enhance your Colima setup with the following optionalcon figurations: -```console -ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose -``` +#### Docker Compose as a Docker Plugin #### -Run docker compose: +Convert `docker-compose` to a Docker plugin for streamlined commands: -```console -docker compose -``` +1. Create a directory for Docker CLI plugins: -Ensure that you see the `docker-compose` usage menu. + ```console + mkdir -p ~/.docker/cli-plugins + ``` -You’ll also need Buildx to build some Docker containers. This is installed -with Docker Engine on macOS, but you can install this with Homebrew: +1. Symlink the `docker-compose` command: -```console -brew install docker-Buildx -``` + ```console + ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose + ``` -Once downloaded, symlink it to the cli-plugins folder: +1. Verify by running: -```console -ln -sfn $(brew --prefix)/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx -``` + ```console + docker compose + ``` -To create a VM with four CPUs, 4GB of memory, and 100GiB of disk space, -follow these options: + Ensure the `docker-compose` usage menu is displayed. -```console -colima stop -``` +#### Installing Buildx #### -Wait for Colima to shutdown the VM. Then restart it with: +Buildx is necessary for building some Docker containers: -```console -colima start --cpu 4 --memory 4 --disk 100 -``` +1. Install Buildx with Homebrew: + + ```console + brew install docker-buildx + ``` + +1. Symlink Buildx to the CLI plugins directory: + + ```console + ln -sfn $(brew --prefix)/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx + ``` + +#### Customizing VM Resources #### + +To customize the VM's resources, such as CPUs, memory, and disk space: + +1. Stop Colima: + + ```console + colima stop + ``` + +1. Restart with desired specifications: + + ```console + colima start --cpu 4 --memory 4 --disk 100 + ``` ### Environment configuration ### From 62d848f3b4c140848d97d378625918583eb519b0 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Wed, 14 Feb 2024 14:38:00 -0600 Subject: [PATCH 04/17] Fix spelling error Co-authored-by: David Harris <123905168+dv4harr10@users.noreply.github.com> --- dev_envs/mac-env-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 78ec305..f3559c7 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -150,7 +150,7 @@ uninstall it before proceeding. ### Optional Configurations ### -Enhance your Colima setup with the following optionalcon figurations: +Enhance your Colima setup with the following optional configurations: #### Docker Compose as a Docker Plugin #### From c451be20296dba112f32db6e95310e34355cf2a7 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Thu, 15 Feb 2024 09:19:22 -0600 Subject: [PATCH 05/17] Remove capitalizations for second level headings Co-authored-by: Shane Frasier --- dev_envs/mac-env-setup.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index f3559c7..8df1b41 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -100,7 +100,7 @@ After installing Brew, you'll want to install other useful packages. We recommend installing all the packages specified in the [CISA `laptop` script repository](https://github.com/cisagov/laptop/blob/master/Brewfile). -### Colima: A Docker Alternative ### +### Colima: A Docker alternative ### For individuals or businesses seeking a container solution without the licensing conditions associated with [Docker](https://www.docker.com/pricing/faq/) @@ -148,11 +148,11 @@ uninstall it before proceeding. The `docker-compose` usage menu should appear. -### Optional Configurations ### +### Optional configurations ### Enhance your Colima setup with the following optional configurations: -#### Docker Compose as a Docker Plugin #### +#### Docker Compose as a Docker plugin #### Convert `docker-compose` to a Docker plugin for streamlined commands: @@ -192,7 +192,7 @@ Buildx is necessary for building some Docker containers: ln -sfn $(brew --prefix)/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx ``` -#### Customizing VM Resources #### +#### Customizing VM resources #### To customize the VM's resources, such as CPUs, memory, and disk space: From 222fd0313339f1369476549193ebaef75ea5a82d Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Thu, 15 Feb 2024 12:55:48 -0600 Subject: [PATCH 06/17] Remove unnecessary capitalizations and newline Co-authored-by: dav3r --- dev_envs/mac-env-setup.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 8df1b41..5f74e6d 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -116,8 +116,7 @@ uninstall it before proceeding. **Installation Steps:** -1. Install Colima and Docker - command-line tools using Homebrew: +1. Install Colima and Docker command-line tools using Homebrew: ```console brew install colima docker docker-compose @@ -129,7 +128,7 @@ uninstall it before proceeding. colima start ``` - This initializes the Docker Daemon within a lightweight VM. + This initializes the Docker daemon within a lightweight VM. The first startup may take a moment. 1. Confirm Docker is operational: From 6601df8be4b1ec95033ebb2845112e0c774b8a8e Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Fri, 16 Feb 2024 13:46:07 -0600 Subject: [PATCH 07/17] Remove hyphen for `docker compose` Co-authored-by: dav3r --- dev_envs/mac-env-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 5f74e6d..8244b1a 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -173,7 +173,7 @@ Convert `docker-compose` to a Docker plugin for streamlined commands: docker compose ``` - Ensure the `docker-compose` usage menu is displayed. + Ensure the `docker compose` usage menu is displayed. #### Installing Buildx #### From 1de77f6132f79817c6ea6581561aa4964daaa161 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Tue, 20 Feb 2024 08:42:27 -0600 Subject: [PATCH 08/17] Add `Desktop` to `Docker Desktop` Co-authored-by: Shane Frasier --- dev_envs/mac-env-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 8244b1a..37291f2 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -103,7 +103,7 @@ packages. We recommend installing all the packages specified in the ### Colima: A Docker alternative ### For individuals or businesses seeking a container solution without -the licensing conditions associated with [Docker](https://www.docker.com/pricing/faq/) +the licensing conditions associated with [Docker Desktop](https://www.docker.com/pricing/faq/) , [Colima](https://github.com/abiosoft/colima) offers a compelling open-source alternative. Compatible with both MacOS and Linux, Colima facilitates running containers directly using Docker From c7f16375609527adb957b49b6c56a5d8c1d4314f Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Wed, 21 Feb 2024 11:15:06 -0600 Subject: [PATCH 09/17] Revert Docker instructions and add note for Colima --- dev_envs/mac-env-setup.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 37291f2..d8d233f 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -43,6 +43,15 @@ sudo xcodebuild -license xcode-select --install ``` +### Docker ### + +> **Note** +> *[Colima](https://github.com/abiosoft/colima) is our preferred solution on macOS.* + +Download the latest stable [Docker Desktop on Mac](https://www.docker.com/products/docker-desktop/). +Install it by double-clicking the downloaded `dmg` file and dragging the +Docker application file to the `Applications` folder. + ### iTerm2 (recommended) ### To set up iTerm2 - a macOS terminal replacement with some nifty features - From 60c4facf05014917fe0c9bf49a8b8637759ce397 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Wed, 21 Feb 2024 14:08:33 -0600 Subject: [PATCH 10/17] Improve format and update link for Colima in markdown Co-authored-by: Shane Frasier --- dev_envs/mac-env-setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index d8d233f..4a2b56f 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -45,8 +45,8 @@ xcode-select --install ### Docker ### -> **Note** -> *[Colima](https://github.com/abiosoft/colima) is our preferred solution on macOS.* +> [!NOTE] +> [Colima](#colima-a-docker-alternative) is our preferred solution on macOS. Download the latest stable [Docker Desktop on Mac](https://www.docker.com/products/docker-desktop/). Install it by double-clicking the downloaded `dmg` file and dragging the From 9beac4bb396218f0177b35ea9a3c6abe0e9d03ff Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Wed, 28 Feb 2024 11:13:35 -0600 Subject: [PATCH 11/17] Guide users to configure Docker daemon with Colima Adds documentation for linking Colima with the Docker daemon. This ensures Docker client tools communicate with Colima's managed Docker daemon, essential for Docker-based applications like Molecule without Docker Desktop. Includes the setup code snippet and its importance for better user understanding and usability in development workflows. --- dev_envs/mac-env-setup.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 4a2b56f..04158ab 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -216,6 +216,20 @@ To customize the VM's resources, such as CPUs, memory, and disk space: colima start --cpu 4 --memory 4 --disk 100 ``` +### Configure Colima's Docker daemon ### + +In your .zshrc profile add the following configuration. + +```console +# Set env variable for Colima compatibility with Docker +export DOCKER_HOST=unix://$HOME/.colima/default/docker.sock +``` + +> **Note** +> This configuration directs Docker client tools to communicate with the +> Docker daemon managed by Colima, ensuring that Docker commands and +> applications (e.g. Molecule) function as expected without Docker Desktop. + ### Environment configuration ### For portability between computers and environments, you may want to switch From d6e7a1995b95cdbd9a28c7d27760e554537fc81e Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Wed, 28 Feb 2024 12:03:19 -0600 Subject: [PATCH 12/17] Change syntax for Note in MD Co-authored-by: Shane Frasier --- dev_envs/mac-env-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 04158ab..dd24642 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -225,7 +225,7 @@ In your .zshrc profile add the following configuration. export DOCKER_HOST=unix://$HOME/.colima/default/docker.sock ``` -> **Note** +> [!NOTE] > This configuration directs Docker client tools to communicate with the > Docker daemon managed by Colima, ensuring that Docker commands and > applications (e.g. Molecule) function as expected without Docker Desktop. From b13cc30d0c5d9ba1960d863d9650d92700c06ebb Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Wed, 28 Feb 2024 13:17:34 -0600 Subject: [PATCH 13/17] Update heading for Docker context support Change the section heading from "Configure Colima's Docker daemon" to "Support applications that are unaware of Docker context" to make it more accurate and reflective of the content. Co-authored-by: dav3r --- dev_envs/mac-env-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index dd24642..fa2eada 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -216,7 +216,7 @@ To customize the VM's resources, such as CPUs, memory, and disk space: colima start --cpu 4 --memory 4 --disk 100 ``` -### Configure Colima's Docker daemon ### +### Support applications that are unaware of Docker context ### In your .zshrc profile add the following configuration. From 66de2ef1fa2731c88372091ad1106d78b1ade546 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Wed, 28 Feb 2024 13:19:13 -0600 Subject: [PATCH 14/17] Add link to Colima FAQ for more info on Docker daemon Co-authored-by: dav3r --- dev_envs/mac-env-setup.md | 1 + 1 file changed, 1 insertion(+) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index fa2eada..1c49466 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -229,6 +229,7 @@ export DOCKER_HOST=unix://$HOME/.colima/default/docker.sock > This configuration directs Docker client tools to communicate with the > Docker daemon managed by Colima, ensuring that Docker commands and > applications (e.g. Molecule) function as expected without Docker Desktop. +> For more information, see [here](https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running). ### Environment configuration ### From d82d867049493e8ed3e338d13b0d390307a395d1 Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Thu, 2 May 2024 12:02:04 -0500 Subject: [PATCH 15/17] Reword some of the documentation for clarity Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com> --- dev_envs/mac-env-setup.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 1c49466..7ddfb15 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -114,7 +114,7 @@ packages. We recommend installing all the packages specified in the For individuals or businesses seeking a container solution without the licensing conditions associated with [Docker Desktop](https://www.docker.com/pricing/faq/) , [Colima](https://github.com/abiosoft/colima) offers a compelling -open-source alternative. Compatible with both MacOS and Linux, +open-source alternative. Compatible with both macOS and Linux, Colima facilitates running containers directly using Docker commands without the need for Docker Desktop. @@ -218,9 +218,9 @@ To customize the VM's resources, such as CPUs, memory, and disk space: ### Support applications that are unaware of Docker context ### -In your .zshrc profile add the following configuration. +In your shell profile (`.bashrc`, `.zshrc`, etc.) add the following configuration. -```console +```shell # Set env variable for Colima compatibility with Docker export DOCKER_HOST=unix://$HOME/.colima/default/docker.sock ``` From ad5f2f0d6c832558edc0036942cfb95b0fe00c3d Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Thu, 2 May 2024 12:03:46 -0500 Subject: [PATCH 16/17] Change "docker-compose" to "docker compose" in documentation Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com> --- dev_envs/mac-env-setup.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 7ddfb15..5d11d35 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -148,13 +148,13 @@ uninstall it before proceeding. You should see the Docker usage menu. -1. Verify `docker-compose` is working: +1. Verify Docker Compose is working: ```console - docker-compose + docker compose ``` - The `docker-compose` usage menu should appear. + The Docker Compose usage menu should appear. ### Optional configurations ### From 8ce2503e2986f93318c97fd1ea32a649917c989f Mon Sep 17 00:00:00 2001 From: Michael Saki Date: Fri, 3 May 2024 08:02:19 -0500 Subject: [PATCH 17/17] Remove plugin configs and move instructions It was discovered that the docker-compose formula is the Compose plugin. It creates a docker-compose binary that is symlinked into the plugins directory. This is also the case for the docker-buildx plugin. Since this is the case it makes sense to remove the instructions for configuring the plugins. The Colima instructions were also moved to be a sub section under the Docker section since Colima relies on Docker under the hood and is simply an alternative to Docker. --- dev_envs/mac-env-setup.md | 160 ++++++++++++++------------------------ 1 file changed, 60 insertions(+), 100 deletions(-) diff --git a/dev_envs/mac-env-setup.md b/dev_envs/mac-env-setup.md index 5d11d35..e9b9431 100644 --- a/dev_envs/mac-env-setup.md +++ b/dev_envs/mac-env-setup.md @@ -52,64 +52,7 @@ Download the latest stable [Docker Desktop on Mac](https://www.docker.com/produc Install it by double-clicking the downloaded `dmg` file and dragging the Docker application file to the `Applications` folder. -### iTerm2 (recommended) ### - -To set up iTerm2 - a macOS terminal replacement with some nifty features - -visit the [iTerm2 download page](https://www.iterm2.com/downloads.html) to -get the latest stable release. Install it by double-clicking the downloaded -`zip` file and dragging the extracted `iTerm` application file to the -`Applications` folder. - -Once installed, run the app and select the menu option -`iTerm2 > Make iTerm2 Default Term`. - -> **Note** -> You may also `Make iTerm2 Default Term` on your standard user account. - -### VPN configuration ### - -Once you're set up with the lab (CAL) VPN connection, we recommend you set up -split-tunneling. Instructions and a generator script are located in the -[vpn-config-gen repository](https://github.com/cisagov/vpn-config-gen). - -## User environment setup ## - -For this section and following sections, log back in as your standard user. - -> **Note** -> If you installed iTerm2 above, run the iTerm2 app and select the menu option -> `iTerm2 > Make iTerm2 Default Term` to make it your default too. - -### Automatic package installation (recommended) ### - -NOTE (DEC 2022): The [CISA `laptop` script] is out of date but still -functional. - -To set up a dev environment via the [CISA `laptop` script], execute -the following in your terminal: - -```bash -bash <(curl --silent https://raw.githubusercontent.com/cisagov/laptop/master/laptop) -``` - -This will `curl` the current install files and script. You can specify -additional packages to install by creating a `Brewfile.local`, as described in -the Readme for the `laptop` repo where an example is provided. - -### Manual package installation (alternative) ### - -Open Terminal and install `brew` per the instructions from -[Homebrew](https://brew.sh). You will probably have to do this with `sudo`. - -```console -/bin/bash -c "$(curl --fail --silent --show-error --location https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" -``` - -After installing Brew, you'll want to install other useful -packages. We recommend installing all the packages specified in the -[CISA `laptop` script repository](https://github.com/cisagov/laptop/blob/master/Brewfile). - -### Colima: A Docker alternative ### +#### Colima: A Docker alternative #### For individuals or businesses seeking a container solution without the licensing conditions associated with [Docker Desktop](https://www.docker.com/pricing/faq/) @@ -156,50 +99,10 @@ uninstall it before proceeding. The Docker Compose usage menu should appear. -### Optional configurations ### +#### Optional configurations #### Enhance your Colima setup with the following optional configurations: -#### Docker Compose as a Docker plugin #### - -Convert `docker-compose` to a Docker plugin for streamlined commands: - -1. Create a directory for Docker CLI plugins: - - ```console - mkdir -p ~/.docker/cli-plugins - ``` - -1. Symlink the `docker-compose` command: - - ```console - ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose - ``` - -1. Verify by running: - - ```console - docker compose - ``` - - Ensure the `docker compose` usage menu is displayed. - -#### Installing Buildx #### - -Buildx is necessary for building some Docker containers: - -1. Install Buildx with Homebrew: - - ```console - brew install docker-buildx - ``` - -1. Symlink Buildx to the CLI plugins directory: - - ```console - ln -sfn $(brew --prefix)/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx - ``` - #### Customizing VM resources #### To customize the VM's resources, such as CPUs, memory, and disk space: @@ -216,7 +119,7 @@ To customize the VM's resources, such as CPUs, memory, and disk space: colima start --cpu 4 --memory 4 --disk 100 ``` -### Support applications that are unaware of Docker context ### +#### Support applications that are unaware of Docker context #### In your shell profile (`.bashrc`, `.zshrc`, etc.) add the following configuration. @@ -231,6 +134,63 @@ export DOCKER_HOST=unix://$HOME/.colima/default/docker.sock > applications (e.g. Molecule) function as expected without Docker Desktop. > For more information, see [here](https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running). +### iTerm2 (recommended) ### + +To set up iTerm2 - a macOS terminal replacement with some nifty features - +visit the [iTerm2 download page](https://www.iterm2.com/downloads.html) to +get the latest stable release. Install it by double-clicking the downloaded +`zip` file and dragging the extracted `iTerm` application file to the +`Applications` folder. + +Once installed, run the app and select the menu option +`iTerm2 > Make iTerm2 Default Term`. + +> **Note** +> You may also `Make iTerm2 Default Term` on your standard user account. + +### VPN configuration ### + +Once you're set up with the lab (CAL) VPN connection, we recommend you set up +split-tunneling. Instructions and a generator script are located in the +[vpn-config-gen repository](https://github.com/cisagov/vpn-config-gen). + +## User environment setup ## + +For this section and following sections, log back in as your standard user. + +> **Note** +> If you installed iTerm2 above, run the iTerm2 app and select the menu option +> `iTerm2 > Make iTerm2 Default Term` to make it your default too. + +### Automatic package installation (recommended) ### + +NOTE (DEC 2022): The [CISA `laptop` script] is out of date but still +functional. + +To set up a dev environment via the [CISA `laptop` script], execute +the following in your terminal: + +```bash +bash <(curl --silent https://raw.githubusercontent.com/cisagov/laptop/master/laptop) +``` + +This will `curl` the current install files and script. You can specify +additional packages to install by creating a `Brewfile.local`, as described in +the Readme for the `laptop` repo where an example is provided. + +### Manual package installation (alternative) ### + +Open Terminal and install `brew` per the instructions from +[Homebrew](https://brew.sh). You will probably have to do this with `sudo`. + +```console +/bin/bash -c "$(curl --fail --silent --show-error --location https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +``` + +After installing Brew, you'll want to install other useful +packages. We recommend installing all the packages specified in the +[CISA `laptop` script repository](https://github.com/cisagov/laptop/blob/master/Brewfile). + ### Environment configuration ### For portability between computers and environments, you may want to switch