我正在通过Colima运行Docker,我的镜像大小总共达到了约10GB。为了继续使用,我需要增加这个大小。
在Colima中是否有定义这个大小的方法?
在Colima中是否有定义这个大小的方法?
Colima 创建的默认虚拟机具有 2 个 CPU、2GiB 内存和 60GiB 存储空间。
可以通过向 colima start 传递其他标志(例如 --cpu、--memory、--disk、--runtime)或使用 colima start --edit 编辑配置文件来自定义虚拟机。
注意:从 v0.5.3 开始,虚拟机创建后无法更改磁盘大小。 现在可以增加磁盘大小。
colima start --cpu 1 --memory 2 --disk 10
colima stop
colima start --cpu 4 --memory 8
colima stop
colima start --disk 100
https://dev59.com/U3oPtIcB2Jgan1znyGXl#74402260 由 @Carlos Cavero 提供
我曾遇到同样的问题,可以通过自定义Colima VMs来调整CPU、内存(GB)和磁盘(GiB)大小:
colima start --cpu 4 --memory 4 --disk 100
但是这很奇怪,因为文档中说明:
由 Colima 创建的默认虚拟机具有 2 个 CPU、2GiB 的内存和 60GiB 存储空间
# ============================================================================================ #
# 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.
colima delete
以获取更新的虚拟机资源。 - undefined
docker system prune
来修剪 Docker 镜像,或者删除并重新创建具有更大磁盘大小的 Colima VM。 - abiosoft