Creating a Neovim Container Image for Airgap Environment

Zhimin Wen
4 min readMay 23, 2023
Image by Rudy and Peter Skitterians from Pixabay

I deal with disconnected environment constantly. I need to have my toolbox prepared before going to these environment. Container image become my 1st choice as it ideally wraps the tools without the need of intrusively installing any dependencies.

Let’s check out a neovim and golang environment I built as a container image.

The Base Dockerfile


WORKDIR /workspace
RUN git clone && \
cd mage && \
go run bootstrap.go && \
cd .. && rm -rf mage && \
curl -LO && \
tar -xzf nvim-linux64.tar.gz && \
rm -rf nvim-linux64.tar.gz && \
mv nvim-linux64 / && \
ln -fs /nvim-linux64/bin/nvim /usr/local/bin/nvim && \
mkdir -p /root/.config/nvim && \
apt update && apt install -y unzip nodejs npm ripgrep && \
git clone ~/.config/nvim

Start with the golang image, add the magefile tool. Then install the neovim as the editor.

Instead customize the neovim configuration from scratch, lets use the NvChad, “Blazing fast Neovim framework providing solid defaults and a beautiful UI, enhancing your neovim experience”. The installation is very straighforward by cloning its github…