You can search for the package using pamac
.
$ pamac search docker
The below will install docker
along with two other packages, containerd
and runc
.
$ pamac install docker
Once installed, start and enable the service to start on boot.
$ sudo systemctl enable --now docker.service
You can test everything is okay and get back some basic information about your environment with the below commands.
$ sudo docker version $ sudo docker info
Add your user to the docker group so you can run docker without first becoming root.
[andy@home-pc ~]$ sudo usermod -aG docker $USER
You will need to logout/login from your DE – or reboot – for the changes to take effect. After the reboot, you should be able to run docker command as your normal user. Go ahead and try to run the docker hello world example.
$ docker run hello-world
The output should indicate everything is working correctly. You may also want to install docker-compose too.
$ pamac install docker-compose
You can list all containers using the ps
command.
[andy@home-pc ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dc8bb75d7529 hello-world "/hello" 7 seconds ago Exited (0) 6 seconds ago clever_albattani
To remove the image, use rm
on the container ID listed above. If you run the below rmi
command, the output will also show you the referenced container ID.
[andy@home-pc ~]$ docker rmi hello-world
Error response from daemon: conflict: unable to remove repository reference "hello-world" (must force) - container dc8bb75d7529 is using its referenced image feb5d9fea6a5
To remove, use the rm
command.
$ docker rm dc8bb75d7529
Now re-run the rmi
command.
[andy@home-pc ~]$ docker rmi hello-world
Untagged: hello-world:latest
Untagged: hello-world@sha256:53f1bbee2f52c39e41682ee1d388285290c5c8a76cc92b42687eecf38e0af3f0
Deleted: sha256:feb5d9fea6a5e9606aa995e879d862b825965ba48de054caab5ef356dc6b3412
Deleted: sha256:e07ee1baac5fae6a26f30cabfe54a36d3402f96afda318fe0a96cec4ca393359
Be the first to comment