Silverblue offically provice toobox as a container, you can manage it with podman. But sometime it cannot meet our needs, thus we need to install docker.

Following offcial document, you will find that docker cannot be installed. Here is how I deal with this.

Installing Docker and Docker Compose

Don’t need to install docker-ce or any other package, just running rpm-ostree ostree install docker to install Docker. if needed, you can run rpm-ostree ostree install docker to install docker-compose.

Start to use docker

After executing reboot your device, now you can run sudo docker run hello-world to test if your docker works fine.

Don’t use SUDO

Execute sudo groupadd docker to ensure you currently have a group named docker, if execute groups and find docker is not in the list, don’t get worry, that‘s exactly the problem.

Now you can run sudo chmod 666 /var/run/docker.sock, then run docker run hello-world, see? Permission is not required anymore, but this cannot last long, if will become fail if you reboot your device. The next step is to fix it.

FIX

At this step, you should append docker:x:998:{user} to /etc/group this works as sudo usermod -aG docker $USER, which not works at Silverblue. (REMEMBER: {user} should be your username, which should be {user}:x:1000: at /etc/group, don’t forget this)

BTW

At Silverblue, you can run sudo systemctl enable docker.service and sudo systemctl start docker.service to start your docker daemon and enable it after restarting your PC.