-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Colima installation over Docker Desktop #96
base: develop
Are you sure you want to change the base?
Changes from 14 commits
475d5d2
52d7fc7
354c576
62d848f
c451be2
222fd03
6601df8
1de77f6
c7f1637
60c4fac
9beac4b
d6e7a19
b13cc30
66de2ef
d82d867
ad5f2f0
8ce2503
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,10 @@ xcode-select --install | |
|
||
### Docker ### | ||
|
||
Download the latest stable [Docker for Mac](https://www.docker.com/docker-mac). | ||
> [!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 | ||
Docker application file to the `Applications` folder. | ||
|
||
|
@@ -106,6 +109,128 @@ 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 ### | ||
|
||
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, | ||
michaelsaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Colima facilitates running containers directly using Docker | ||
commands without the need for Docker Desktop. | ||
|
||
#### Installing Colima #### | ||
|
||
**Prerequisites:** If Docker Desktop is installed on your system, | ||
uninstall it before proceeding. | ||
|
||
**Installation Steps:** | ||
|
||
1. Install Colima and Docker command-line tools using Homebrew: | ||
|
||
```console | ||
brew install colima docker docker-compose | ||
``` | ||
|
||
1. Verify the installation by starting Colima: | ||
|
||
```console | ||
colima start | ||
``` | ||
|
||
This initializes the Docker daemon within a lightweight VM. | ||
The first startup may take a moment. | ||
|
||
1. Confirm Docker is operational: | ||
|
||
```console | ||
docker | ||
``` | ||
|
||
You should see the Docker usage menu. | ||
|
||
1. Verify `docker-compose` is working: | ||
michaelsaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```console | ||
docker-compose | ||
michaelsaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
The `docker-compose` usage menu should appear. | ||
michaelsaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Optional configurations ### | ||
|
||
Enhance your Colima setup with the following optional configurations: | ||
|
||
#### Docker Compose as a Docker plugin #### | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! Verified it on my end. Everything looks good without the config stuff. See here: 8ce2503 |
||
|
||
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 #### | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also already installed as a Docker plugin by the formula per the formula's code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See here: 8ce2503 |
||
|
||
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: | ||
|
||
1. Stop Colima: | ||
|
||
```console | ||
colima stop | ||
``` | ||
|
||
1. Restart with desired specifications: | ||
|
||
```console | ||
colima start --cpu 4 --memory 4 --disk 100 | ||
``` | ||
|
||
### Support applications that are unaware of Docker context ### | ||
|
||
In your .zshrc profile add the following configuration. | ||
michaelsaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```console | ||
michaelsaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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. | ||
michaelsaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> 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 ### | ||
|
||
For portability between computers and environments, you may want to switch | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like this whole section to be a sub-section for Docker (above). It still relies on Docker under the hood (by default) and simply provides an alternative for Docker Desktop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcdonnnj see here 8ce2503