-
-
Notifications
You must be signed in to change notification settings - Fork 107
chore: docker fixes, including clean bootstrap #372
base: main
Are you sure you want to change the base?
Conversation
Hi @edwintorok, testing this on macos I get the following error. It seems to work if I set I guess we'll need to detect if the user is using the podman-docker wrapper or just vanilla docker. Do you have any ideas on the best way to do this?
|
Thanks for testing, should be possible to detect |
31a410f
to
9011cac
Compare
This works on Fedora 36+podman and Ubuntu 22.04+docker now, @connorgmeehan could you test again please and let me know if it works on your system? |
2ad89e4
to
e638f46
Compare
https://hub.docker.com/_/archlinux/?tab=description says: "Arch Linux is a rolling release distribution, so a full update is recommended when installing new packages. In other words, we suggest to either execute RUN pacman -Syu immediately after your FROM statement or as soon as you docker run into a container." Without this there are some errors about LIBC_2.36 when installing new packages brings in packages depending on it, but the installed libc is still 2.35. Signed-off-by: Edwin Török <edwin@etorok.net>
The docker-podman wrapper created volume mounts are owned by the root user inside the container, and the doom user wouldn't have write access. Need to specify --user-ns=keep-id flag to map $UID from the host to $UID from the container without using subuids: that way user inside container can modify. SELinux is on by default on Fedora36, thus volume mounts need to specify the 'Z' flag to relabel the directory being mounted. podman needs '--userns=keep-id' for permissions of mounted volumes to work inside the container. However docker doesn't recognize that flag (and doesn't need it, since it is running as root). Detect which of `docker` or `podman` is installed, and if it is podman add the extra flag. We need to check for podman first, because 'docker' might just be a wrapper that calls podman. Signed-off-by: Edwin Török <edwin@etorok.net>
Signed-off-by: Edwin Török <edwin@etorok.net>
Signed-off-by: Edwin Török <edwin@etorok.net>
Signed-off-by: Edwin Török <edwin@etorok.net>
When running doom for the first time (or after ~/.local/share/nvim/site is cleaned) doom will bootstrap itself by calling packer.sync(). However that happens asynchronously, so do not call DoomStarted in this case: doom is not ready yet. This will allow to safely run the following command to synchronize doom config with packages: ``` nvim --headless --cmd "autocmd User PackerComplete quitall" --cmd "autocmd User DoomStarted PackerSync" ``` Previously such a command wouldn't have been safe on initial run due to the implicit packer.sync: 2 packer syncs running at the same time would show a lot of lua module errors about modules not found, it is best avoided. On subsequent runs it would've been safe but it is useful to have a single command to run that is always safe. This should also make it possible to use a similar command in a CI to wait for the installation of packages and then test that the doom config works. Signed-off-by: Edwin Török <edwin@etorok.net>
Otherwise you get a prompt to pick a registry to pull the image from (since it failed to build locally). Signed-off-by: Edwin Török <edwin@etorok.net>
Signed-off-by: Edwin Török <edwin@etorok.net>
e638f46
to
e275d0a
Compare
I pushed a few more docker fixes, including a script that can bootstrap nvim from a fresh dir, and another that just deletes the packer_compiled.lua to make testing changes easier. |
The docker-podman wrapper created volume mounts are owned by the root
user inside the container, and the doom user wouldn't have write access.
Need to specify --user-ns=keep-id flag to map $UID from the host to $UID
from the container without using subuids: that way user inside container
can modify.
SELinux is on by default on Fedora36, thus volume mounts need to specify
the 'Z' flag to relabel the directory being mounted.
I've only tested this on Fedora, applies on top of #371.
Opened as a separate PR since it might need testing on other OSes, to check that the docker command still works there, in particular on non-SELinux systems.