Skip to content

vincentvdk/toolbx-containers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker

Toolbx containers

Source to build toolbox container images containing all tools and config that I use on a daily basis.

⚠️⚠️ DISCLAIMER: This project is still in flux and should be used at your own risk ⚠️⚠️

toolbox

this project currently has 2 images:

  • base-toolbox toolbox (general purpose toolbox)
  • vim-toolbox (uses base-toolbox as a base + neovim)

Motivation

I work as a freelance Cloud Engineer / SRE and often need seperate environments for different customers. Sometimes I even need different environments for multiple teams at a single customer.

Requirements

These toolboxes are based on Fedora as I run them on Fedora Silverblue. They are not tested on other distributions.

What's in the toolboxes?

Packages

  • tmux
  • asdf

NeoVim

  • Plugins are managed by Packer which seems to be the go-to plugin manager for Neovim.
  • Language server (LSP) is handled by neovim-lsp.
  • Telescope takes care of fuzzy finding.

efm-langserver

efm is a General Purpose Language server and is used to format/lint using the build in LSP. https://github.com/mattn/efm-langserver

go install github.com/mattn/efm-langserver@latest

Theme

I use the Nightfox theme.

How to use the toolbox

Build container images

From the root of this project run:

podman build -t toolbox/nvim nvim-toolbox/

Create and run a toolbox using the container image

Create a toolbox with the name mytoolbox

$ toolbox create -i toolbox/nvim mytoolbox
Created container: mytoolbox
Enter with: toolbox enter mytoolbox

Run the toolbox

toolbox enter mytoolbox

I always use tmux for work in a terminal. Since it's part of the container image you can run it from the toolbox. But you can also get a tmux session in one go

toolbox run -c mytoolbox tmux

How secrets are managed

How binaries are managed.

A lot of the tools that I use can be installed by downloading a binary, make it executable and add it to a location in $PATH. Example: Terraform, kubectl, golang, ...

Adding all these to the container image would cause it to become quite big which is something I want to prevent. therefore the useful asdf tool will be used. This tool will install and manage the versions for the binaries we need, but will put them on the host system (so not in the container - $ASDF_DATA_DIR).

Best way to explain it is by showing some examples

Example: Install golang

asdf plugin add golang
asdf install golang 1.19.1
asdf global golang 1.19.1
asdf current golang

Check the asdf documentation (run asdf without options to get options)

References

Dependencies

The following packages are needed for NeoVim plugins (Treesitter)

dnf install gcc clang

Troubleshooting

Issue: When opening help in NeoVim you see the following error: cannot find -lstdc++: No such file or directory Solution: install gcc clang lstdc++-static lstdc++ and run in vim :TSUpdate

NOTE: It is a good idea to run TSUpdate after an update of TreeSitter