I am using the Docker image nixos/nix:latest for my GitLab CI/CD pipeline.
In my CI script, I use the command addgroup. My CI pipeline was working yesterday but since today (2021-12-15), it is broken with the error addgroup: command not found.
I can see that nixos/nix:latest has changed in the last 24 hours so I suspect it is the cause of my broken pipeline.
What is the right way to get access to addgroup with the new Docker image nixos/nix:latest?
As @mausch mentioned docker imaged after 2.3.x are not based on any image and built with Nix.
There are few ways how you can add a group to the image. Which way you choose to go depends on your situation at hand.
The most Nix way would be to extend the docker image from nix repository with Nix. And create groups and users as we do in docker.nix. Ofcourse this method requires you to know quite some Nix and how to do it.
You can also just extend the docker image as you would usually do with Dockerfile, but use Nix to install all the utilities you need.
FROM nixos/nix
RUN nix-channel --update
RUN nix-env -iA nixpkgs.shadow
RUN groupadd veryspecialgroup ...