rockyourcode: Notes on “Avoid These Common Mistakes Junior Developers Make”, Docker Desktop Alternatives for macOs
Hello 👋! Thanks for subscribing.
These are my last two articles from February and March:
Notes on “Avoid These Common Mistakes Junior Developers Make”
Published on: 2022-03-06
tags: Notes, Lab
Here are some notes on Dave Farley’s video on Youtube.
-
Software Developers Is All About Coding
Software development is about solving problems, not about code.
-
If Only the Business Would Get the Requirements Right
This sentences completely misses the point. It assumes that developers are paid to code, and that someone else will tell them what to do.
Nobody really knows what users want. Everyone is guessing. The job of developers is to build systems in a world of uncertainty.
The goal is to protect against bad guesses and to incrementally evolve solutions to problems, so that we have freedom to make mistakes.
-
Speed Is All That Matters
Take the time to think. Once the problem is clear, the coding is easy.
Optimize for learning, not for feature production
-
My Job Is to Code, Not to Understand the Problem Domain
You don’t have to be a domain expert, but you need to have a surface level understanding. Try to see the real problem in the real world.
-
I Can’t Ask for Help. It Shows That I Don’t Know Enough.
Smart people ask questions. Get comfortable with uncertainty.
Give yourself the freedom to ask twice. If you have to ask a third time, go to the person answering and explain that you didn’t understand it and ask for help.
-
Software Architecture Is for the Experts
You should be able to explain how the system works. Could you explain it to your (non-technical) friend?
What are the organizing principles that really matter?
What ideas help you to decide where to place behavior in your system? -
Testing Is Someone Else’s Job!
Developers should write tests. Developers are responsible for building the system, sothey should be able to test if it works.
-
I Would Like to Do a Better Job, but My Boss Won’t Let Me!
This could be a cultural problem. But at some point, we must take responsibility for our own work.
Focus on the stuff that you can control, and take ownership of it.
Links
Docker Desktop Alternatives for macOs
Published on: 2022-02-06
tags: DevOps, MacOs, Docker, Kubernetes
In this article I will show you two alternatives for Docker Desktop on macOs.
But why?
Docker has introduced new pricing changes to their Docker Desktop utility. This doesn’t affect small companies or personal projects.
But the license change has sparked a new discussion about Docker Desktop alternatives, and I was interested in testing them out.
I settled on the following two tools: Rancher Desktop and Colima.
1. Rancher Desktop
Rancher Desktop is an open-source Electron.js desktop application. You can install Rancher Desktop on macOs, Windows and Linux.
Installation (via Homebrew):
brew install --cask rancher
You’ll still need the docker command-line tool (CLI).
Rancher can install it via their GUI (graphical user interface) in the “Supporting Utilities” Tab. Alternatively, you can install it separately.
(If you want to use docker compose v2, you’ll need to have it on your machine - check the instructions below or read the Rancher Desktop FAQ.)
Stop Docker Desktop, if you still have it on your machine. (You can have it installed, but you should not start the utility.)
Rancher Desktop offers a GUI to install and manage Kubernetes-cluster and container.
You can choose between containerd or dockerd/Moby as a container runtime.
If you use containerd, you can manage your containers with nerdctl. If you choose dockerd, you can continue using the docker command line tool.
In that case all well-known docker commands will still work, for example docker ps
.
2. Colima
Colima is an alternative to Docker Desktop that’s solely available as a command-line utility.
Under the hood Colima uses the Lima-VM, same as Rancher Desktop.
Lima launches Linux virtual machines with automatic file sharing and port forwarding (similar to WSL2), and containerd.
Installation:
brew install colima
Stop Docker Desktop, if you still have it on your machine. (You can have it installed, but you should not start the utility.)
You’ll still need the docker command-line tool (CLI).
(If you want to use docker compose v2, you’ll need to install it on your machine.)
If you now try to use docker, it won’t work:
docker ps
> Can’t connect to the Docker daemon at unix:///var/run/docker.sock.
> Is the docker daemon running?
Start colima:
colima start
You can customize the virtual machine:
colima start --cpu 2 --memory 8 --disk 10
Now everything should work without problems.
If you don’t want to use Colima anymore, reset the Docker context. Colima overwrites the context in /Users/<usernane>/.docker/config.json
:
docker context use default
How to Install Docker and Docker Compose v2
If you rip out Docker Desktop from your Mac, you’ll need to take care of installing the necessary command-line tools.
You can install docker via Homebrew:
brew install docker
Install compose v2.
For Intel:
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-darwin-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
For M1/ARM:
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-darwin-aarch64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
Check if docker compose
works:
docker compose version
Credentials Error
You might get the following error when you try to pull images:
Error saving credentials: error storing credentials - err: exec: “docker-credential-osxkeychain”: executable file not found in $PATH, out:
Install the docker credentials helper:
brew install docker-credential-helper
Links
- Lima VM
- Colima
- Rancher Desktop
- Rancher Desktop documentaion
- Rancher Desktop FAQ
- Hacker News “Docker for Mac Without Docker Desktop”
- Compose v2
- Goodbye Docker Desktop for Mac, Hello Colima by Jacob Tomlinson
Thank you for reading my blog.