Skip to content

Instantly share code, notes, and snippets.

@karfau
Last active June 19, 2020 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karfau/338ef5b1e9e50b9598b7a5bd4830b7b1 to your computer and use it in GitHub Desktop.
Save karfau/338ef5b1e9e50b9598b7a5bd4830b7b1 to your computer and use it in GitHub Desktop.
Aliases for docker and docker-compose alongside podman
# With my local setup in Manjaro I'm using https://podman.io/ as a rootless docker replacement:
# https://podman.io/getting-started/installation#arch-linux--manjaro-linux
# To be able to still run the real docker when required, but use podman by default I added this link:
# /usr/local/bin/docker -> /usr/bin/podman
# I wanted to have an easy way to switch to real docker and back so I created the following aliases:
# <name>su switches on <name>, un<name> switches off <name>
# since the tools all require docker daemon to run and calling 'sudo <name>',
# but most scripts assume it works wihtout sudo
# docker
alias dockersu='sudo systemctl start docker && alias docker="sudo /usr/bin/docker"'
alias undocker='sudo systemctl stop docker && unalias docker'
# docker-compose (doco)
alias docosu='sudo systemctl start docker && alias docker-compose="sudo docker-compose"'
alias undoco='sudo systemctl stop docker && unalias docker-compose'
# both in one command
alias docsu='dockersu && docosu'
alias undoc='undocker && undoco'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment