Skip to content

Commit e6b17b6

Browse files
authored
chore: update Lima example (#5588)
* chore: lima: update ubuntu image version * fix: lima: make docker socket usable by Lima user without sudo * fix: lima: set access URL to host.lima.internal * apply suggestion from PR
1 parent 0124289 commit e6b17b6

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

examples/lima/coder.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
# This example requires Lima v0.8.3 or later.
99
images:
1010
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
11-
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220420/ubuntu-22.04-server-cloudimg-amd64.img"
11+
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20221201/ubuntu-22.04-server-cloudimg-amd64.img"
1212
arch: "x86_64"
13-
digest: "sha256:de5e632e17b8965f2baf4ea6d2b824788e154d9a65df4fd419ec4019898e15cd"
14-
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220420/ubuntu-22.04-server-cloudimg-arm64.img"
13+
digest: "sha256:8a814737df484d9e2f4cb2c04c91629aea2fced6799fc36f77376f0da91dba65"
14+
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20221201/ubuntu-22.04-server-cloudimg-arm64.img"
1515
arch: "aarch64"
16-
digest: "sha256:66224c7fed99ff5a5539eda406c87bbfefe8af6ff6b47d92df3187832b5b5d4f"
16+
digest: "sha256:8a0477adcbdadefd58ae5c0625b53bbe618aedfe69983b824da8d02be0a8c961"
1717
# Fallback to the latest release image.
1818
# Hint: run `limactl prune` to invalidate the cache
1919
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
@@ -58,6 +58,13 @@ provision:
5858
systemctl restart docker
5959
# In case a user forgets to set the arch correctly, just install binfmt
6060
docker run --privileged --rm tonistiigi/binfmt --install all
61+
# Also ensure that the Lima user has access to the Docker daemon without sudo.
62+
# The 'right' way to to do this is with the Docker group, but Lima keeps the
63+
# SSH session around. We don't want users to have to manually delete ~/.lima/$VM/ssh.sock
64+
# so we're just instead going to modify the perms on the Docker socket.
65+
# See: https://github.com/lima-vm/lima/issues/528
66+
chown ${LIMA_CIDATA_USER} /var/run/docker.sock
67+
chmod og+rwx /var/run/docker.sock
6168
- mode: system
6269
script: |
6370
#!/bin/bash
@@ -81,6 +88,8 @@ provision:
8188
usermod -aG docker coder
8289
# Ensure coder listens on all interfaces
8390
sed -i 's/CODER_ADDRESS=.*/CODER_ADDRESS=0.0.0.0:3000/' /etc/coder.d/coder.env
91+
# Also set the access URL to host.lima.internal for fast deployments
92+
sed -i 's#CODER_ACCESS_URL=.*#CODER_ACCESS_URL=http://host.lima.internal:3000#' /etc/coder.d/coder.env
8493
# Ensure coder starts on boot
8594
systemctl enable coder
8695
systemctl start coder

0 commit comments

Comments
 (0)