This artcile is written almost entirely because I want to send this to new members of my team(s) and have (hopefully) very similar environments on all our dev machines.
Should You Follow This?
You should only follow this guide if …
- You are using Ubuntu (or derivative distros)
- You want to reduce pain and maximize joy when working in a team.
- (optional) You are an engineer at FringeCore_ (this is an opinion piece)
1. Install Docker
I would highly highly encourage the use of the convenience script to install Docker. I’m actually rather surprised more people aren’t using this method of installation (maybe it’s because it’s not on top of the list).
2. Setup Docker Rootless
Using sudo
every time you run a docker command is a pain, and often it makes it impossible
to automate.
2.1. Setup
Hopefully the above commands should just run as-is.
2.2. Ask Docker CLI to Use It
Open ~/.bashrc
in an editor. (Yes, I use nano. Fight me.)
Paste this at the very end.
Save and exit out of the eidtor with Ctrl
+O
, Enter
, Ctrl
+X
.
2.3. Reload Your Terminal environments
3. Allow Privileged Ports
Who install nginx on the host machine anymore anyway.
4. Start + Start-up
5. Enable Long Running Processes
That don’t exit as soon as you close your terminal.
This section is copied directly from my 🐋 Stop Rootless Docker From Exiting post.
5.1. Enable Linger
5.2. Edit systemd’s Login Session Config
Open /etc/systemd/logind.conf
in a privileged editor.
Add this to the end.
Then restart the docker service.
6. (Optional) Allow Rootless Docker to pass NVIDIA GPU
Open up this file in your text editor. /etc/nvidia-container-runtime/config.toml
Steps:
- Find the line
#no-cgroups = false
under[nvidia-container-cli]
- Uncomment the line.
- Change it to
true
This will allow rootless docker and docker compose to forward GPU with all its various capabilities to containers.
Done
Enough opinions on how to setup your environment for the day. Welcome to our team.