Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created October 31, 2021 13:58
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save vfarcic/0a3e9e48dd1de03146339dd17d16bc20 to your computer and use it in GitHub Desktop.
Save vfarcic/0a3e9e48dd1de03146339dd17d16bc20 to your computer and use it in GitHub Desktop.
# Referenced videos:
# How to run local multi-node Kubernetes clusters using kind: https://youtu.be/C0v5gJSWuSo
# K3d - How to run Kubernetes cluster locally using Rancher K3s: https://youtu.be/mCesuGk-Fks
# Should We Replace Docker Desktop With Rancher Desktop?: https://youtu.be/bYVfCp9dRTE
# What Do Developers Really Need (And How Can Ops Help)?: https://youtu.be/gxx8EM08ihs
#########
# Setup #
#########
git clone https://github.com/vfarcic/rancher-nerdctl-demo
cd rancher-nerdctl-demo
# Replace `[...]` with your Docker Hub user
export DH_USER=[...]
# Replace `[...]` with your Docker Hub password
export DH_PASS=[...]
######################
# Installing nerdctl #
######################
# Start Rancher Desktop
# Make sure that `nerdctl` is selected
nerdctl help
alias docker=nerdctl
# That should be added to `~/.bashrc` or `~/.zshrc`
docker help
###################################
# Running Containers With nerdctl #
###################################
docker container ls
docker container run --rm -it \
alpine echo "Is it working?"
###############################
# Docker Compose With nerdctl #
###############################
docker compose up --detach
docker container ls
docker compose down
#################################
# Container Images With nerdctl #
#################################
docker image build \
--tag $DH_USER/devops-toolkit \
.
docker login \
--username $DH_USER \
--password $DH_PASS
docker image push $DH_USER/devops-toolkit
docker image tag \
$DH_USER/devops-toolkit \
$DH_USER/devops-toolkit:0.0.1
docker image ls
####################
# Missing features #
####################
docker system prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment