Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| install_docker [2026/09/10 22:41] – system | install_docker [2026/09/10 23:34] (current) – [Working with the Docker containers] system | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ===== Install Docker ===== | ===== Install Docker ===== | ||
| - | * We assume that you are a user-named **system** on a standard Ubuntu installation. | + | * We assume that you are a user named **system** on a standard Ubuntu |
| * Set up the Docker repository: | * Set up the Docker repository: | ||
| <code bash> | <code bash> | ||
| Line 39: | Line 39: | ||
| </ | </ | ||
| * After running this, you must log out and log back in //(or run newgrp docker)// for the group changes to take effect. | * After running this, you must log out and log back in //(or run newgrp docker)// for the group changes to take effect. | ||
| + | * Verify the install | ||
| <code bash> | <code bash> | ||
| - | USER=" | + | docker --version |
| + | docker compose version | ||
| + | docker run hello-world | ||
| + | #---- This was the output --- | ||
| + | Unable to find image ' | ||
| + | latest: Pulling from library/ | ||
| + | 4f55086f7dd0: | ||
| + | d5e71e642bf5: | ||
| + | Digest: sha256: | ||
| + | Status: Downloaded newer image for hello-world: | ||
| - | sudo apt-get update | + | Hello from Docker! |
| - | sudo apt-get install -y \ | + | This message shows that your installation appears to be working correctly. |
| - | ca-certificates \ | + | |
| - | curl \ | + | |
| - | gnupg \ | + | |
| - | lsb-release | + | |
| - | sudo curl -fsSL https://download.docker.com/ | + | To generate this message, Docker took the following steps: |
| + | 1. The Docker client contacted the Docker daemon. | ||
| + | 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. | ||
| + | (amd64) | ||
| + | 3. The Docker daemon created a new container from that image which runs the | ||
| + | executable that produces the output you are currently reading. | ||
| + | 4. The Docker daemon streamed that output to the Docker client, which sent it | ||
| + | to your terminal. | ||
| - | echo \ | + | To try something more ambitious, you can run an Ubuntu container with: |
| - | " | + | $ docker |
| - | $(lsb_release -cs) stable" | + | |
| - | sudo apt-get update | + | Share images, automate workflows, and more with a free Docker ID: |
| - | sudo apt-get -y install | + | https:// |
| - | sudo apt-get -y install docker-compose | + | |
| - | # Make docker run as non root | + | For more examples and ideas, visit: |
| - | sudo usermod -aG docker $USER | + | https://docs.docker.com/ |
| - | sudo chmod 666 /var/run/docker.sock | + | |
| - | # customize it with your own. | ||
| - | sudo mkdir -p /mnt/data | ||
| - | # make sure all future data in this folder can be created as non root | ||
| - | sudo chown $USER:$USER /mnt/data | ||
| </ | </ | ||
| + | <WRAP center round tip 100%> | ||
| ===== Starting with a clean slate ===== | ===== Starting with a clean slate ===== | ||
| * You might have some existing docker containers and images that you first want to get rid of. | * You might have some existing docker containers and images that you first want to get rid of. | ||
| Line 79: | Line 85: | ||
| docker network rm radiusdesk-bridge | docker network rm radiusdesk-bridge | ||
| </ | </ | ||
| + | </ | ||
| ===== Create the Docker containers ===== | ===== Create the Docker containers ===== | ||
| - | * Everything you need to create the RADIUSdesk Docker containers | + | * Everything you need to create the RADIUSdesk Docker containers |
| * Check out the **rdcore** git repository. | * Check out the **rdcore** git repository. | ||
| <code bash> | <code bash> | ||
| Line 131: | Line 138: | ||
| * Open a browser and call up the IP address of the host on which the Docker containers are running. | * Open a browser and call up the IP address of the host on which the Docker containers are running. | ||
| + | |||
| + | ===== Working with the Docker containers ===== | ||
| + | * The docker containers can be seen as a lightweight Linux machine. | ||
| + | ==== Who is active? ==== | ||
| + | |||
| + | * To see which docker containers are running: | ||
| + | <code bash> | ||
| + | docker ps | ||
| + | #This was the reply on my machine | ||
| + | CONTAINER ID | ||
| + | 5c99a3eb667b | ||
| + | 881209d31244 | ||
| + | </ | ||
| + | ==== Shell access ==== | ||
| + | * If you like the Linux shell then you will feel at home inside a Docker container. | ||
| + | * You can shell into the radiusdesk container with the following command: | ||
| + | <code bash> | ||
| + | docker exec -it radiusdesk bash | ||
| + | </ | ||
| + | * To make a backup of the DB you can issue: | ||
| + | <code bash> | ||
| + | mysqldump -h radiusdesk-mariadb -u rd -p --events rd > /tmp/rd.sql | ||
| + | </ | ||
| + | * There are also a vi editor and the ping command installed for basic editing and network troubleshooting. | ||
| + | * To exit out of the docker container simply type **exit**. | ||
| + | * You can shell into the radiusdesk-mariadb container with the following command: | ||
| + | <code bash> | ||
| + | docker exec -it radiusdesk-mariadb bash | ||
| + | </ | ||
| + | ==== Log output ==== | ||
| + | * Again if you like the fact that you can check log files to confirm everything works well then Docker containers got you covered. | ||
| + | * You can run the following command to check the log output of the radiusdesk container: | ||
| + | <code bash> | ||
| + | docker logs radiusdesk --tail 20 -f | ||
| + | </ | ||
| + | * For the log output of radiusdesk-mariadb: | ||
| + | <code bash> | ||
| + | docker logs radiusdesk-mariadb --tail 20 -f | ||
| + | </ | ||