Exercises to complete:
- Update your system
- Add the Docker repository and refresh repositories if needed
- Install Docker
- Enable and start Docker service
- Verify the Docker installation
To install Docker, you can follow these steps. Please note that you need to have sudo privileges or root access.
SLES 15 / openSUSE Leap 15.4
- Update your system:
Firstly, make sure your package list and the system is up to date.
|
|
- Install Docker:
Now, you can install Docker with the following command.
|
|
- Enable and start Docker service:
After the installation, you need to start Docker and enable it to start at boot.
|
|
- Verify the Docker installation:
To ensure Docker has been installed correctly, you can check the installed version of Docker.
|
|
This should display the version of Docker installed on your system. You can also run a simple Docker command such as:
|
|
This command downloads a test image and runs it in a container. If it runs without errors, it’s a good indication that Docker is functioning correctly.
Remember, in order to run Docker commands as a non-root user without prepending sudo, you need to add the user to the docker group:
|
|
Then you need to log out and log back in so that your group membership is refreshed.
That’s it! You have successfully installed Docker.
Debian 11
To install Docker on Debian 11, follow these steps:
Step 1: Update the System
First, update your existing list of packages:
|
|
Next, upgrade the packages:
|
|
Step 2: Install the Necessary Software
Docker requires some packages that are not installed by default, including packages to allow apt to use a repository over HTTPS:
|
|
Step 3: Add Docker’s GPG Key
Next, add Docker’s official GPG key:
|
|
Step 4: Set up the Docker Stable Repository
Then, use the following command to set up the stable Docker repository:
|
|
Step 5: Install Docker CE (Community Edition)
Update the apt
package list and install the latest version of Docker CE:
|
|
Step 6: Verify the Docker Installation
Finally, verify that Docker CE is installed correctly by running the hello-world Docker image:
|
|
This command downloads a test image and runs it in a container. If it runs successfully, it prints an informational message and exits.
You should now have Docker installed on your Debian 11 system. If you want to run Docker commands as a non-root user without prepending sudo
, you’ll need to add your user to the docker
group:
|
|
You may need to log out and back in for these changes to take effect.
Red Hat 9
Red Hat Enterprise Linux 9 has removed Docker from its official repositories. However, you can still install Docker using other methods.
One such alternative is using Podman, which is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. Containers can either be run as root or in rootless mode.
If you want to install Docker, here is a way to do it:
- Setup the repository:
|
|
- Install Docker Engine:
|
|
- Start Docker:
|
|
- Verify that Docker Engine is installed correctly by running the hello-world image:
|
|
- Enable Docker to start on boot:
|
|
Please note that the installation process might slightly differ based on the exact version of your RHEL system and the system setup. If any of the steps does not work as expected, refer to the Docker official documentation.
Remember that using Docker requires root privileges so make sure to use sudo with Docker commands, or give Docker these privileges correctly.
If you want to use a more RHEL native solution, consider using Podman and Buildah. These tools provide similar functionalities to Docker but are designed with a different architecture that doesn’t require a daemon and run as a normal user.
Also, be aware that running the Docker daemon on your system can have security implications; you should understand these before deciding to use Docker.