10000 v0.2.0. Go rewrite and new features by abiosoft · Pull Request #19 · abiosoft/colima · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

v0.2.0. Go rewrite and new features #19

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

Merged
merged 79 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
a7c8037
go rewrite: replicate cli
abiosoft Sep 13, 2021
a039361
go rewrite: replicate colima and docker (untested)
abiosoft Sep 14, 2021
f9bf2a3
go rewrite: restructure packages
abiosoft Sep 15, 2021
cc7ab5c
go rewrite: restructure packages
abiosoft Sep 15, 2021
7ad3e9b
go rewrite: checkpoint
abiosoft Sep 16, 2021
90b5dcb
go rewrite: checkpoint
abiosoft Sep 17, 2021
e5537a3
go rewrite: refactors
abiosoft Sep 18, 2021
6f6dbc6
go rewrite: checkpoint
abiosoft Sep 19, 2021
ced67e7
go rewrite: more refactor, getting closer
abiosoft Sep 19, 2021
7103a78
go rewrite: add dry-run for testing, getting closer
abiosoft Sep 19, 2021
254cc5c
go rewrite: fix command and log outputs
abiosoft Sep 19, 2021
e35089c
go rewrite: start and stop fixed
abiosoft Sep 20, 2021
60793e4
go rewrite: docker runtime works end to end
abiosoft Sep 20, 2021
dac3458
go rewrite: containerd runtime works end to end
abiosoft Sep 20, 2021
675682b
go rewrite: fix docker version
abiosoft Sep 21, 2021
0af2073
go rewrite: fix dns config
abiosoft Sep 21, 2021
525f02b
go rewrite: checkpoint - app state management
abiosoft Sep 22, 2021
ad0b6b6
go rewrite: checkpoint - app state management
abiosoft Sep 23, 2021
d023d7d
go rewrite: checkpoint - nerdctl and docker runtimes work end to end
abiosoft Sep 23, 2021
337eaa0
go rewrite: checkpoint - fix nerdctl install
abiosoft Sep 23, 2021
2842034
go rewrite: checkpoint - kubernetes implementation
abiosoft Sep 23, 2021
6877ab6
go rewrite: checkpoint - rename runtime to environment to disambiguat…
abiosoft Sep 23, 2021
c93d0a9
go rewrite: checkpoint - rename runtime to environment, refactor
abiosoft Sep 23, 2021
944e490
go rewrite: checkpoint - kubernetes implementation
abiosoft Sep 23, 2021
1c53e83
go rewrite: checkpoint - kubernetes implementation, kubeconfig
abiosoft Sep 24, 2021
9cfeca6
go rewrite: checkpoint - kubernetes implementation done, untested
abiosoft Sep 24, 2021
febe882
go rewrite: kubernetes implementation done end to end. untested.
abiosoft Sep 24, 2021
36f80b8
go rewrite: kubernetes provision and startup successful
abiosoft Sep 24, 2021
2f16e2a
go rewrite: kubernetes containerd works end to end
abiosoft Sep 25, 2021
0a1e182
go rewrite: kubernetes - fix docker runtime regression
abiosoft Sep 25, 2021
e6a31bf
go rewrite: kubernetes - fix containerd runtime network
abiosoft Sep 26, 2021
b44b420
go rewrite: kubernetes implementation complete
abiosoft Sep 26, 2021
480f457
go rewrite: minor refactor with handling host env vars
abiosoft Sep 26, 2021
c792a9d
kubernetes: cache downloaded dependencies
abiosoft Sep 26, 2021
ca9887d
kubernetes: restructure commands to enable/disable
abiosoft Sep 26, 2021
cb59b59
kubernetes: replace minikube with k3s
abiosoft Sep 27, 2021
113e277
kubernetes: fix containerd networking regression
abiosoft Sep 27, 2021
85a3876
kubernetes: fix stop/delete of containers and docker images cache
abiosoft Sep 27, 2021
6b528bd
kubernetes: fix cluttering of kube config directory
abiosoft Sep 27, 2021
9e1841d
kubernetes: disable traefik
abiosoft Sep 27, 2021
a95624b
colima: add undocumented minimal multi-profile support
abiosoft Sep 27, 2021
b91ac3f
generate code refactor
abiosoft Sep 29, 2021
889f6cf
hide internal flags
abiosoft Sep 29, 2021
6013f0a
kubernetes: minor documentation update
abiosoft Sep 29, 2021
617d63b
shutdown should firstly terminate kubernetes if running
abiosoft Sep 30, 2021
c4b2776
development: make ssh port configurable
abiosoft Oct 8, 2021
a89c1c9
refactor: move root command to own package
abiosoft Oct 8, 2021
85adc4b
development: use unique names for non-default profile directory
abiosoft Oct 8, 2021
a3238da
dns: disable lima host resolver when custom dns is set
abiosoft Oct 9, 2021
d142ca3
kubernetes: improve status check
abiosoft Oct 9, 2021
608bf73
log: use logger library
abiosoft Oct 9, 2021
4f978ec
log: nit picks
abiosoft Oct 9, 2021
899d8c9
log: add verbose flag
abiosoft Oct 9, 2021
ebcd858
log: use more interactive log output
abiosoft Oct 9, 2021
1836d1f
log: improved logging and download progress bar
abiosoft Oct 10, 2021
97cb525
mounts: add volume mount support
abiosoft Oct 10, 2021
ca038e2
mounts: fix writeable mounts
abiosoft Oct 10, 2021
1f8f46d
log: nitpick refactors
abiosoft Oct 10, 2021
1d1c5da
Create go.yml
abiosoft Oct 11, 2021
7ec5784
readme: add build status
abiosoft Oct 11, 2021
31411c9
misc: minor documentation updates
abiosoft Oct 11, 2021
1a4e97d
misc: minor documentation updates
abiosoft Oct 11, 2021
f776fc1
readme: update to reflect v0.2.0 features
abiosoft Oct 11, 2021
4388894
chore: improve log and version output
abiosoft Oct 11, 2021
c39f145
chore: add release script
abiosoft Oct 11, 2021
65fbc8a
chore: update release script to support GitHub releases
abiosoft Oct 11, 2021
f286e92
chore: update k3s and ubuntu version
abiosoft Oct 12, 2021
f3863a0
build script: add github release
abiosoft Oct 12, 2021
702955f
chore: set default memory to 2GiB
abiosoft Oct 12, 2021
aa15863
nerdctl: fix install when existing file is a symlink
abiosoft Oct 12, 2021
854a3ed
kubernetes: fix regression for docker runtime
abiosoft Oct 12, 2021
b02ac10
log: trim useless timestamp and log level for lima commands
abiosoft Oct 12, 2021
6ad1ef1
docker: make daemon.json editable for additional configs
abiosoft Oct 12, 2021
08a552d
readme: update demonstration gif
abiosoft Oct 12, 2021
6542f13
docker: fix regression of daemon.json file loading
abiosoft Oct 12, 2021
7a0f66b
nerdctl: minor documentation update
abiosoft Oct 12, 2021
305d01f
readme: update wordings
abiosoft Oct 12, 2021
bf39fce
docker: ascertain docker socket on startup
abiosoft Oct 12, 2021
d13be0f
kubernetes: fix kubeconfig update when previous teardown was incomplete
abiosoft Oct 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Go

on:
push:
branches: [ main, golang-rewrite ]
pull_request:
branches: [ main ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
.vscode/
.vscode/
_output/
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
all: dev

clean:
rm -rf _output

dev:
go get -v ./cmd/colima

release:
sh release.sh ${VERSION}

gh_release:
GITHUB=1 sh release.sh ${VERSION}
94 changes: 56 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# Colima

Docker (and Kubernetes) on macOS with minimal setup.
[![Go](https://github.com/abiosoft/colima/actions/workflows/go.yml/badge.svg)](https://github.com/abiosoft/colima/actions/workflows/go.yml)

Container runtimes on macOS with minimal setup.

![Demonstration](colima.gif)

## Features

- Simple CLI interface
- Docker and Containerd support
- Port Forwarding
- Volume mounts
- Kubernetes


## Getting Started

### Prerequisites

Colima requires [Lima](https://github.com/lima-vm/lima) and Docker client (and kubectl if Kubernetes will be enabled).
Colima requires [Lima](https://github.com/lima-vm/lima), Docker client (for Docker runtime) and kubectl (if Kubernetes will be enabled).

```
brew install lima docker kubectl
Expand All @@ -17,19 +28,20 @@ brew install lima docker kubectl
### Installation

```
curl -LO https://raw.githubusercontent.com/abiosoft/colima/v0.1.10/colima && sudo install colima /usr/local/bin/colima
curl -LO https://github.com/abiosoft/colima/releases/download/v0.2.0/colima-amd64 && sudo install colima-amd64 /usr/local/bin/colima
```

Verify install

```sh
```
colima version
```

Command line usage
Command line usages

```
colima --help
colima start --help
```

## Usage
Expand All @@ -39,20 +51,30 @@ colima --help
`colima start` starts and setup Docker by default.
You can use the `docker` client on macOS after `colima start` with no additional setup.

### Containerd

`colima start --runtime containerd` starts and setup Containerd. You can use `colima nerdctl` to interact with Containerd using [nerdctl](https://github.com/containerd/nerdctl).

It is recommended to run `colima nerdctl install` to install `nerdctl` alias script in $PATH.

### Kubernetes

To enable Kubernetes, start Colima with `--with-kubernetes` flag.
Colima uses minikube in background which requires at least 2CPUs and ~2.2GiB memory to run.

Colima's Docker runtime is used for Kubernetes. Therefore, images built or pulled with Docker are accessible to Kubernetes.

```
colima start --with-kubernetes
```

#### Interacting with Image Registry

For Docker runtime, images built or pulled with Docker are accessible to Kubernetes.

For Containerd runtime, images built or pulled in the `k8s.io` namespace are accessible to Kubernetes.


### Customizing the VM

The default VM created by Colima has 2 CPUs, 4GiB memory and 60GiB storage.
The default VM created by Colima has 2 CPUs, 2GiB memory and 60GiB storage.

The VM can be customized by passing `--cpu`, `--memory` and `--disk` to `colima start`.
If VM is already created, stop the VM and apply the flags when starting it.
Expand All @@ -78,44 +100,48 @@ If VM is already created, stop the VM and apply the flags when starting it.

To provide container runtimes on macOS with minimal setup.

The current version is in usable alpha state and provides Docker and Kubernetes using Docker runtime.
If there is enough interest in the project, the plan is a rewrite in Go with added flexibility to
support other container runtimes (e.g. containerd/nerdctl, cri-o/podman).

## What is with the name?

Colima means COntainers in LIMA
Colima means Containers in Lima.

Since Lima is aka Linux on Mac. By transitivity, Colima can also mean Containers on Linux on Mac.

## FAQ

<details>
<summary>Can it run alongside Docker for Mac?</summary>
<p>

No. Colima assumes to be the default Docker context and will conflict with Docker for Mac. You should run either, not both.
No, except when started with Containerd runtime. Colima assumes to be the default Docker context and will conflict with Docker for Mac. You should run either, not both.

</p>
</details>

<details>
<summary>What about Docker Volumes and Docker Compose?</summary>
<summary>How to enable writable volumes?</summary>
<p>

Colima mounts the host's $HOME directory as readonly in the VM. Volume mounts and docker compose should work as expected but only readonly.
By default, Colima mounts the host's $HOME directory as readonly in the VM. Volume mounts and Compose should work as expected but only readonly.

Colima uses Lima for the VM and Lima's support for writeable volumes is still experimental.
Volumes are thereby made readonly in Colima for now.
Colima uses Lima for the VM and Lima's support for writable volumes is still experimental.
It is recommended to only mount the necessary directories as writable rather than the entire $HOME directory.

The following mounts $HOME/projects and $HOME/work directories as writable.

```
colima start --mount $HOME/projects:w --mount $HOME/work:w
```

</p>
</details>

<details>
<summary>What about Ports?</summary>
<summary>How to customize Docker config e.g. add insecure registries?</summary>
<p>

Port forwarding are automatic and accessible on the macOS host.
On first startup, Colima generates Docker daemon.json file at `$HOME/.colima/docker/daemon.json`.

Currently, privileged ports are not forwarded i.e. ports (1-1023). This is a limitation of Lima.
Simply modify the daemon.json file accordingly and restart Colima.

</p>
</details>
Expand All @@ -135,34 +161,26 @@ Minikube with Docker runtime can expose the cluster's Docker with `minikube dock
- Kubernetes is not optional, even if you only need Docker.

- All of minikube's free drivers for macOS fall-short in one of performance, port forwarding or volumes.
While port-forwarding and volumes are non-issue for Kubernetes, they can be deal breaker for Docker-only use.
While port-forwarding and volumes are non-issue for Kubernetes, they can be a deal breaker for Docker-only use.

</p>
</details>


<details>
<summary>How can I enable verbose output?</summary>
<summary>Are M1 macs supported?</summary>
<p>

The log file is at $HOME/.colima/out.log, you can simply tail it.

```
tail -f $HOME/.colima/out.log
```
Colima is written to support M1 macs but not tested, as the author do not currently possess an M1 device.

</p>
</details>

<details>
<summary>What about M1 macs?</summary>
<p>

M1 m 65D6 acs should work, but not tested.
## Help Wanted

The challenge is installing Lima on M1 macs, instructions are available on [Lima project page](https://github.com/lima-vm/lima/blob/master/README.md#installation).

</p>
</details>
- Homebrew formula
- Documentation page
- Testing on M1 Macs

## License

Expand Down
Loading
0