Skip to content
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

chore: multiple minor updates #1083

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 31 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@

## Features

Support for Intel and Apple Silicion Macs
- Simple CLI interface
- Support for multiple runtimes including Docker and Containerd
- Port Forwarding
Support for Intel and Apple Silicion Macs, and Linux
- Simple CLI interface with sensible defaults
- Automatic Port Forwarding
- Volume mounts
- Kubernetes
- Multiple instances
- Support for multiple container runtimes
- [Docker](https://docker.com) (with optional Kubernetes)
- [Containerd](https://containerd.io) (with optional Kubernetes)
- [Incus](https://linuxcontainers.org/incus) (containers only)

## Getting Started

Expand Down Expand Up @@ -103,6 +105,25 @@ For Docker runtime, images built or pulled with Docker are accessible to Kuberne

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

### Incus

<small>**Requires v0.7.0**</small>


Incus client is required for Incus runtime. Installable with brew `brew install incus`.

`colima start --runtime incus` starts and setup Incus.

You can use the `incus` client on macOS after `colima start` with no additional setup.


### None

<small>**Requires v0.7.0**</small>

Colima can also be utilised solely as a headless virtual machine manager by specifying `none` runtime.


### Customizing the VM

The default VM created by Colima has 2 CPUs, 2GiB memory and 60GiB storage.
Expand All @@ -111,7 +132,7 @@ The VM can be customized either by passing additional flags to `colima start`.
e.g. `--cpu`, `--memory`, `--disk`, `--runtime`.
Or by editing the config file with `colima start --edit`.

**NOTE**: ~~disk size cannot be changed after the VM is created.~~ From v0.5.3, disk size can be increased
**NOTE**: ~~disk size cannot be changed after the VM is created.~~ From v0.5.3, disk size can be increased when Qemu is used.

#### Customization Examples

Expand All @@ -128,10 +149,10 @@ Or by editing the config file with `colima start --edit`.
colima start --cpu 4 --memory 8
```

- create VM with Rosetta 2 emulation. Requires v0.5.3 and MacOS >= 13 (Ventura)
- create VM with Rosetta 2 emulation. Requires v0.5.3 and MacOS >= 13 (Ventura) on Apple Silicon.

```
colima start --arch aarch64 --vm-type=vz --vz-rosetta
colima start --vm-type=vz --vz-rosetta
```

## Project Goal
Expand All @@ -140,9 +161,9 @@ To provide container runtimes on macOS with minimal setup.

## What is with the name?

Colima means Containers in [Lima](https://github.com/lima-vm/lima).
Colima means Containers on [Lima](https://github.com/lima-vm/lima).

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

## And the Logo?

Expand Down
38 changes: 29 additions & 9 deletions config/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,51 @@ func (r *requiredDir) Dir() string {
var (
configBaseDir = requiredDir{
dir: func() (string, error) {
// colima home explicit config
dir := os.Getenv("COLIMA_HOME")
if _, err := os.Stat(dir); err == nil {
return dir, nil
}

dir, err := os.UserHomeDir()
// user home directory
homeDir, err := os.UserHomeDir()
if err != nil {
return "", err
}
dir = filepath.Join(dir, ".colima")
// colima's config directory based on home directory
dir = filepath.Join(homeDir, ".colima")
// validate existence of colima's config directory
_, err = os.Stat(dir)
// TODO: remove macOS when QEMU_SYSTEM_ARCH is handled properly upstream.
if err == nil || util.MacOS() {

// extra xdg config directory
xdgDir, xdg := os.LookupEnv("XDG_CONFIG_HOME")

if err == nil {
// ~/.colima is found but xdg dir is set
if xdg {
logrus.Warnln("found ~/.colima, ignoring $XDG_CONFIG_HOME...")
logrus.Warnln("delete ~/.colima to use $XDG_CONFIG_HOME as config directory")
logrus.Warnf("or run `mv ~/.colima \"%s\"`", filepath.Join(xdgDir, "colima"))
}
return dir, nil
} else {
// ~/.colima is missing and xdg dir is set
if xdg {
return filepath.Join(xdgDir, "colima"), nil
}
}
// else
dir = os.Getenv("XDG_CONFIG_HOME")
if dir != "" {
return filepath.Join(dir, "colima"), nil

// macOS users are accustomed to ~/.colima
if util.MacOS() {
return dir, nil
}
// else

// other environments fall back to user config directory
dir, err = os.UserConfigDir()
if err != nil {
return "", err
}

return filepath.Join(dir, "colima"), nil
},
}
Expand Down
4 changes: 2 additions & 2 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Binaries are available with every release on the [releases page](https://github.

```sh
# download binary
curl -LO https://github.com/abiosoft/colima/releases/download/v0.6.10/colima-$(uname)-$(uname -m)
curl -LO https://github.com/abiosoft/colima/releases/download/v0.7.0/colima-$(uname)-$(uname -m)

# install in $PATH
install colima-$(uname)-$(uname -m) /usr/local/bin/colima # or sudo install if /usr/local/bin requires root.
Expand All @@ -69,5 +69,5 @@ Requires [Go](https://golang.org).
git clone https://github.com/abiosoft/colima
cd colima
make
make install # or `sudo make install` if /usr/local/bin requires root
sudo make install
```
16 changes: 8 additions & 8 deletions embedded/images/images.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
arm64 none https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-arm64-none.qcow2 9280acf673eb8a6106c5c01fce3dea43f0c646285eadfccea59f2ce67938819a1bbeb01fa718a607bf053e10bde3732b84bd0505e92bbaa2a7dc7aa081b51016 ubuntu-24.04-minimal-cloudimg-arm64-none.qcow2
arm64 docker https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2 445916f8aaf28d2b3ec12da4fb498d8272d7f49b9d6481c27128261fd12ec571bea92af8020fd7b9118234baf469dd6759db895ad4bc713ca8970585833b3dff ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2
arm64 containerd https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2 1c6dc8e30239d3b85c15298a1793fa4eecc7fd757b46ba168ca870f29377adee3824fcbccede977558f877a3869eccbc88e34e82ffcef671a1d6059c5a8fcea9 ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2
arm64 incus https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-arm64-incus.qcow2 a3935126fae39475ca709839872f101b4272287534068e81121e6e24f70805f0e341cba44d5e2d916de5ac9e5ce37fe01aae3035a0f91188eafdfedaf78a45c5 ubuntu-24.04-minimal-cloudimg-arm64-incus.qcow2
amd64 none https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-amd64-none.qcow2 955ff40f1abe547cc2dc3a150ca0a4ca4b237ba8fd55e9a56da80c35c716e5a275e5b7ade5a7f6bf34de2141849e2afe697f44950d0a5a2b4126fce8a118f15c ubuntu-24.04-minimal-cloudimg-amd64-none.qcow2
amd64 docker https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2 4677d834e4d42c98d74207d8608a48132fd9e42265be4eadbf03d47a128221ef2b58410052815af65df9210c3ef95bbc9bbabe9c0c9ba94dde7aa8b744f5a5f9 ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2
amd64 containerd https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-amd64-containerd.qcow2 cb4ac71a864e1ad17e1be23a5b9f6739d6235b6a5944d6428c24ad8e87477d0adcccf994fdd42bc4936e297f58e8dda8b194ffff9631d33b2b0c06f4853bb5b3 ubuntu-24.04-minimal-cloudimg-amd64-containerd.qcow2
amd64 incus https://github.com/abiosoft/colima-core/releases/download/v0.7.0-2/ubuntu-24.04-minimal-cloudimg-amd64-incus.qcow2 072e24fd5d79ebd1108ec15227eb347ad3497eca6caf5b34461706865718752e2fdb359933a73624eca7c66fc58de0b3184e19e5cfe3bb68262b47ef17c993eb ubuntu-24.04-minimal-cloudimg-amd64-incus.qcow2
arm64 none https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-arm64-none.qcow2 a73b0d5673122b796c4b0e296723e1151cce7ff1870298be68421eae8268ad1385045b4033d3477bda6872e6799e20e09d673ec82da16d2d23f60140af94807b ubuntu-24.04-minimal-cloudimg-arm64-none.qcow2
arm64 docker https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2 4c6f3b90067629ebe9bad3c156d6f849ccfb54585ec1af0ee72a9f58c20b9794504a6742e74c9259056db951f9f6d9168a303ea819219278a54f4df4c66a3cf6 ubuntu-24.04-minimal-cloudimg-arm64-docker.qcow2
arm64 containerd https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2 90c22e7774de57ba7bc894f806fc711b01a4062dd82af5ed6a5c97957a55fd8f8fb6a16bd0fd4bc7c453f8973e18e6978fd395b6166c3668c26ab6f18f755612 ubuntu-24.04-minimal-cloudimg-arm64-containerd.qcow2
arm64 incus https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-arm64-incus.qcow2 f61d12e6b92377ac507675ac42f7676ab3a9aa02853d1b0296dd85ee408f3cd1401bc5147550bc3e0e11a5e85d03ad7eaa5d85496c74ad3561548b3d59aacee3 ubuntu-24.04-minimal-cloudimg-arm64-incus.qcow2
amd64 none https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-amd64-none.qcow2 dcf9e12132590f7d16ac6477722acd31bec6640130a75a6fa0fc20160b7d776b370f4c80092b3614230c3f39f8c6fd29b3cce0a727d90e2abd7d47c989238a6f ubuntu-24.04-minimal-cloudimg-amd64-none.qcow2
amd64 docker https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2 1542a27a2ce95f28d0f9ccf2f41f0445ea85a7ea146f8842d962d03c78c182ed854f54ce914d1cfccf8547d8d35ab6992d675f885f430f3147321b654a6d4242 ubuntu-24.04-minimal-cloudimg-amd64-docker.qcow2
amd64 containerd https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-amd64-containerd.qcow2 9fac4edef9b7f84477f69880f9be265cb72fd01ecea7c9e7d716d7da5a7fb3380c54b0205f7163c53a0d12d933d6f0ac3203333140262891d0d23cb1842ebcf1 ubuntu-24.04-minimal-cloudimg-amd64-containerd.qcow2
amd64 incus https://github.com/abiosoft/colima-core/releases/download/v0.7.0-3/ubuntu-24.04-minimal-cloudimg-amd64-incus.qcow2 2780a9a63eff69e1396de17417b2f7928f736122dd7309d036f0804f3a18e971bc6b173486c8ed98f62d46ed1423cf305fa9e43839a63e37f8e599bc80c2f0bc ubuntu-24.04-minimal-cloudimg-amd64-incus.qcow2
2 changes: 1 addition & 1 deletion embedded/images/images_sha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eux

BASE_URL=https://github.com/abiosoft/colima-core/releases/download
BASE_FILENAME=ubuntu-24.04-minimal-cloudimg
VERSION=v0.7.0-2
VERSION=v0.7.0-3
RUNTIMES="none docker containerd incus"
ARCHS="arm64 amd64"

Expand Down
Loading