6

I'm running docker through colima and my total images size hit ~10GBs. I need to increase this size in order to continue.

Is there a way to define this somewhere in colima?

Carlos Cavero
  • 3,011
  • 5
  • 21
  • 41
Deniss M.
  • 3,617
  • 17
  • 52
  • 100
  • 2
    You have not given enough details. Why do you need to increase the size? Has the VM run out of disk space? You can prune docker images with `docker system prune` or delete and recreate the Colima VM with a larger disk size. – abiosoft Oct 13 '22 at 07:09
  • I need it because I have several running containers that use images with sizes at least 5gb. One example is kafka ;) – Deniss M. Oct 14 '22 at 13:55

3 Answers3

12

Colima - Customizing the VM

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

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

Customization Examples

create VM with 1CPU, 2GiB memory and 10GiB storage.

colima start --cpu 1 --memory 2 --disk 10

modify an existing VM to 4CPUs and 8GiB memory.

colima stop
colima start --cpu 4 --memory 8

resize storage to 100 GB.

colima stop
colima start --disk 100

Reference

https://stackoverflow.com/a/74402260/9345651 by @Carlos Cavero

https://github.com/abiosoft/colima#customizing-the-vm

https://github.com/abiosoft/colima/blob/main/docs/FAQ.md

ctr-27
  • 121
  • 1
  • 4
  • 1
    This is no longer correct. From Colima v0.5.3, disk size can be increased https://github.com/abiosoft/colima#customizing-the-vm – Tom Davies Apr 06 '23 at 09:51
11

I had the same issue and it is possible to customise Colima VMs CPU, Memory (GB) and Disk (GiB):

colima start --cpu 4 --memory 4 --disk 100

But it is weird because the documentation states:

the default VM created by Colima has 2 CPUs, 2GiB memory and 60GiB storage

Carlos Cavero
  • 3,011
  • 5
  • 21
  • 41
  • 2
    Can't believe I was searching for the error in my Dockerfile, just to find out that it was Colima having too low memory. – Emir Husic Mar 14 '23 at 15:04
0

Run colima template and customize the default machine template so you land directly in it the next time you run colima start.

# ============================================================================================ #
# To abort, delete the contents of this file including the comments and save as an empty file
# ============================================================================================ #

# New instances will be created with the following configurations.

# Number of CPUs to be allocated to the virtual machine.
# Default: 2
cpu: 4

# Size of the disk in GiB to be allocated to the virtual machine.
# NOTE: changing this has no effect after the virtual machine has been created.
# Default: 60
disk: 120

# Size of the memory in GiB to be allocated to the virtual machine.
# Default: 2
memory: 12

# Architecture of the virtual machine (x86_64, aarch64, host).
# Default: host
arch: host

# Container runtime to be used (docker, containerd).
# Default: docker
runtime: docker

# Kubernetes configuration for the virtual machine.
kubernetes:
  # Enable kubernetes.
  # Default: false
  enabled: false

  # Kubernetes version to use.
  # This needs to exactly match a k3s version https://github.com/k3s-io/k3s/releases
  # Default: latest stable release
  version: v1.24.3+k3s1

  # Additional args to pass to k3s https://docs.k3s.io/cli/server
  # Default: traefik is disabled
  k3sArgs:
    - --disable=traefik

# Auto-activate on the Host for client access.
# Setting to true does the following on startup
#  - sets as active Docker context (for Docker runtime).
#  - sets as active Kubernetes context (if Kubernetes is enabled).
# Default: true
autoActivate: true

# Network configurations for the virtual machine.
network:
  # Assign reachable IP address to the virtual machine.
  # NOTE: this is currently macOS only and ignored on Linux.
  # Default: false
  address: false

  # Custom DNS resolvers for the virtual machine.
  #
  # EXAMPLE
  # dns: [8.8.8.8, 1.1.1.1]
  #
  # Default: []
  dns: []

  # DNS hostnames to resolve to custom targets using the internal resolver.
  # This setting has no effect if a custom DNS resolver list is supplied above.
  # It does not configure the /etc/hosts files of any machine or container.
  # The value can be an IP address or another host.
  #
  # EXAMPLE
  # dnsHosts:
  #   example.com: 1.2.3.4
  dnsHosts:
    host.docker.internal: host.lima.internal

  # Network driver to use (slirp, gvproxy), (requires vmType `qemu`)
  #   - slirp is the default user mode networking provided by Qemu
  #   - gvproxy is an alternative to VPNKit based on gVisor https://github.com/containers/gvisor-tap-vsock
  # Default: gvproxy
  driver: gvproxy

# ===================================================================== #
# ADVANCED CONFIGURATION
# ===================================================================== #

# Forward the host's SSH agent to the virtual machine.

Marcos
  • 1,043
  • 10
  • 15