Tuesday, October 1, 2024

Creating liberating content

Linux Mint 22.1 Slated...

The Linux Mint 22.1 distribution was slated for release in December 2024 with...

Mozilla Firefox 131 Is...

Mozilla Firefox 131 open-source web browser is now available for download with supports...

Audacious 4.4.1 Open-Source Audio...

Audacious 4.4.1 open-source media player is now availablewith titlebar dimming for Winamp skins,...

FFmpeg 7.1 “Péter” Released...

FFmpeg 7.1 open-source multimedia framework is now available for download with a full...
Homebut as a text-based AIInstall Docker on...

Install Docker on Arch Linux

Install Docker on Arch Linux

Installing Docker on Arch Linux is easy. It is available in the Extra repository and you can simply do the pacman magic:

sudo pacman -S docker

But there are more steps involved here to run Docker on Arch Linux properly. It all comes down to these steps:

  • Install Docker from Arch repository
  • Start the Docker daemon and run it automatically at each boot
  • Add user to docker group to run docker commands without sudo

Let's see the steps in detail.

Step 1: Installing Docker package

Open the terminal and use the following command:

sudo pacman -S docker

Enter the password and press Y when asked for it.

Install Docker on Arch Linux

It may take some time depending on the mirror you are using.

💡
If you see a package not found or 404 error, your sync database is perhaps old. Update the system (it will download a lot of packages and take time) with: sudo pacman -Syu

Step 2: Start docker daemon

Docker is installed but it is not running. You should start the dcoker daemon before running the Docker command for the first time:

sudo systemctl start docker.service

I also suggest enabling the Docker service so that the docker daemon starts automatically when your system boots.

sudo systemctl enable docker.service

This way, you can just start running docker commands. You won't need to manually start the docker service anymore.

Install Docker on Arch Linux

Step 3: Add user to docker group

Docker is installed and the Docker service is running. You are almost ready to run docker commands.

However, by default, you need to use sudo with docker commands. And that's annoying.

To avoid using sudo with each docker command, you can add yourself (or any other user) to the docker group like this:

sudo usermod -aG docker $USER

You must log out (or close the terminal) and log back in for the above change to take effect. If you don't want to do that, use this command:

newgrp docker

Now the stage is set. Let's test it.

Step 4: Verify docker installation

There is a tiny docker image provided by docker itself to test the docker installation. Run it and see if everything works well:

docker run hello-world

You should see output like this for successful docker run:

Install Docker on Arch Linux

Congratulations! You have successfully installed Docker on Arch Linux.

Optional: Install Docker Compose

Docker Compose has become an integral part of Docker. It allows you to manage multiple container applications.

The older classic compose is provided by the docker-compose Python package. Docker has also ported it to Go and provides it with docker compose but this package comes with Docker Desktop.

At this stage, I would suggest going with the classic docker-compose plugin and install it with this command:

sudo pacman -S docker-compose
Install Docker on Arch Linux

Troubleshooting Tips

Here are some common issues you may face and the possible solutions:

Tab completion not working for docker sub commands

If you want to use tab completion for the docker command options (like completing im to images etc), install the bash-completion package:

sudo pacman -S bash-completion

Close the terminal and start a new one. You should be able to use tab completion with Docker commands now.

Cannot connect to the Docker daemon error

If you see the following error:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

That's because the docker daemon is not running. Refer to step 2 and start the docker service, make sure it is running and enable it so that docker daemon runs automatically at each boot.

sudo systemctl start docker.service
sudo systemctl enable docker.service

Permission denied while trying to connect to Docker daemon socket

If you see this error:

docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

That's because you need to either run the docker command with sudo or add the user to docker group to run docker commands without sudo.

I hope this quick post helps you run Docker on Arch Linux.

from It’s FOSS https://ift.tt/Vpxd4Dc

Get notified whenever we post something new!

spot_img

Create a website from scratch

Just drag and drop elements in a page to get started with Newspaper Theme.

Continue reading

Linux Mint 22.1 Slated for Release in December with Revamped Cinnamon Theme

The Linux Mint 22.1 distribution was slated for release in December 2024 with a revamped Cinnamon theme and better package management. Here's a sneak peek! The post Linux Mint 22.1 Slated for Release in December with Revamped Cinnamon Theme appeared...

Mozilla Firefox 131 Is Now Available for Download, Here’s What’s New

Mozilla Firefox 131 open-source web browser is now available for download with supports for text fragments, improved translations, temporarily site permissions, and more. The post Mozilla Firefox 131 Is Now Available for Download, Here’s What’s New appeared first on 9to5Linux...

Audacious 4.4.1 Open-Source Audio Player Brings New Features and Improvements

Audacious 4.4.1 open-source media player is now availablewith titlebar dimming for Winamp skins, improved control responsiveness, Qt 6 support for the Qt Multimedia output plugin, and more. The post Audacious 4.4.1 Open-Source Audio Player Brings New Features and Improvements appeared...

Enjoy exclusive access to all of our content

Get an online subscription and you can unlock any article you come across.