Skip to content

Instantly share code, notes, and snippets.

@dmitmel
Created November 10, 2025 17:20
Show Gist options
  • Select an option

  • Save dmitmel/687db6bcae0fa4bdcafce7264babd574 to your computer and use it in GitHub Desktop.

Select an option

Save dmitmel/687db6bcae0fa4bdcafce7264babd574 to your computer and use it in GitHub Desktop.
A dockerfile I used to build appimages for versions of neovim before v0.2.2
FROM ubuntu:18.04
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential git curl cmake pkg-config ninja-build gettext autoconf libtool-bin lua5.1 \
lua5.1-lpeg lua5.1-mpack lua5.1-bitop fuse unzip gperf wget python2.7 && \
update-alternatives --install /usr/bin/python2 python2 /usr/bin/python2.7 1
CMD \
if [ ! -d /src ] || [ -z "$(ls -A /src)" ]; then \
git clone https://github.com/neovim/neovim.git /src; \
fi && \
cd /src && \
git clean -fdx && \
git reset --hard && \
git checkout v0.2.0 && \
curl -Lf https://github.com/neovim/neovim/commit/7c836573977e5e86962cdb346b8537b78a36eb90.patch | git apply - && \
curl -Lf https://github.com/neovim/neovim/commit/3c0cc028b7e787e3e87f21976d8b6333bf488219.patch | git apply --exclude=Makefile - && \
curl -Lf https://github.com/neovim/neovim/commit/26235bc050abece269737fd2b77bbc392d45ffc1.patch | git apply - && \
printf >'local.mk' 'DEPS_CMAKE_FLAGS += %s\n' '-DUSE_BUNDLED_LUA=OFF' '-DUSE_BUNDLED_LUAROCKS=OFF' '-DUSE_BUNDLED_GPERF=OFF' && \
sed -i 's|^\(set(LUAJIT_URL https://github\.com/neovim/deps/raw/\)master\(/opt/LuaJIT-2\.0\.4\.tar\.gz)\)$|\15fd93800ba93ba7163b4cd76ed6aabef81fce416\2|' third-party/CMakeLists.txt && \
sed -i 's|^\( "-DCMAKE_C_FLAGS:STRING=\${CMAKE_C_COMPILER_ARG1} -fPIC\)"$|\1 -Wno-error=implicit-fallthrough"|' third-party/cmake/BuildMsgpack.cmake && \
SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)" bash -e scripts/genappimage.sh
#!/usr/bin/env bash
set -euo pipefail
mkdir -p src
sudo docker build -t neovims .
sudo docker run \
--device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \
-u "$(id -u):$(id -g)" -v "${PWD}/src:/src" -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group \
--rm -it neovims
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment