dogi is a simple and transparent wrapper for docker run
(and docker exec
) to make common tasks easier.
It allows using rootless containers, running GUIs, quickly mounting your current directory and much more!
Even though dogi was originally inspired by rocker and solves a similar problem (or the same), it aims to do so with minimum user effort. Additionally, it provides the ability to interact with the docker
client directly (transparent).
# install binary
mkdir -pv ~/go/bin
wget -qO- https://github.com/ntorresalberto/dogi/releases/download/rolling/dogi-rolling-linux-amd64.tar.gz | tar xvz -C ~/go/bin
# add bash autocompletion
echo 'source <(dogi completion bash)' >> ~/.bashrc
# try it!
dogi run ubuntu
# update it easily
dogi update
Some optional setup steps might be required.
NOTE: You can also install from source: CGO_ENABLED=0 go install -a github.com/ntorresalberto/dogi@latest
dogi update
dogi update --commit=aee8c7f
dogi run ubuntu
dogi run --no-user ubuntu # as root
dogi run --home ubuntu # share your home directory inside container
dogi exec
dogi exec --no-user # as root
dogi exec <container-name>
xeyes
is not installed in the ubuntu
image by default) dogi run ubuntu -- bash -c "sudo apt install -y x11-apps && xeyes"
dogi run ubuntu --no-user -- bash -c "apt update && apt install -y x11-apps && xeyes" # as root
dogi run fedora -- bash -c "sudo dnf install -y xeyes && xeyes"
dogi run fedora --no-user -- bash -c "dnf install -y xeyes && xeyes" # as root
dogi run ubuntu -- bash -c "sudo apt install -y mesa-utils && glxgears"
dogi run ubuntu --no-user -- bash -c "apt install -y mesa-utils && glxgears" # as root
dogi prune
You should find dogi useful if you:
Many (open source) hackers are proud if they achieve large amounts of code, because they believe the more lines of code they've written, the more progress they have made. The more progress they have made, the more skilled they are. This is simply a delusion.
from the suckless.org Manifest
git clone https://github.com/ntorresalberto/dogi.git
cd dogi
make install
dogi -v # test it!
Once installed, add autocompletion with:
echo 'source <(dogi completion bash)' >> ~/.bashrc
installing go
You need golang>=1.16 installed (check version with go version
).
On ubuntu, an updated version can easily be installed with one of these 2 ways:
sudo apt install golang # ubuntu >= 22.04
sudo snap install go --classic
bash: dogi: command not found
This error message means your $PATH
doesn't include the go binaries path.
You can fix it like this or, if you only want to enable dogi, use:
echo "alias dogi=$(go env GOPATH)/bin/dogi" >> ~/.bashrc
source .bashrc
dogi: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by dogi)
This error is usually caused by a container running an older version of glibc than your host system (where you compiled dogi
).
A possible cause of this is you didn't use CGO_ENABLED=0
in the go install
, as specified in #quickstart.