Installing Docker on Ubuntu VM via Guacamole

Accessing the VM via Guacamole:

Docker Installation:

  1. Follow the [official documentation](https://docs.docker.com/engine/install/ubuntu/) to install Docker on Ubuntu using the repository.
  2. Run the following commands:
    sudo apt update
    sudo apt install docker-ce docker-ce-cli containerd.io

Installation Verification:

Additional Configuration

Installation Verification

- Basic Commands:

docker info  # Displays information about the Docker engine.
docker ps    # Displays running containers.
docker ps -a # Displays all containers.

Searching on Docker Hub

- Download and run an Nginx container:

docker pull nginx
docker run --name "test_nginx" nginx

- To access Nginx, configure the port correctly:

docker stop test_nginx
docker rm test_nginx
docker run -p 8080:80 --name "test_nginx" nginx

Using Other Containers

- Launch a Funkwhale container:

docker run --name funky_container -p 80:80 funkwhale/all-in-one:1.0.1
docker rm -f funky_container  # Remove the container after use.

Optional: Wordpress, MYSQL, and Environment Variables

- Create a network for Wordpress:

docker network create wordpress

- Download and run a MySQL container:

docker run --name mysql_container -e MYSQL_ROOT_PASSWORD=<password> -e MYSQL_DATABASE=<dbname> -e MYSQL_USER=<dbuser> -e MYSQL_PASSWORD=<dbpassword> -d mysql:5.7

- Download and run a Wordpress container:

docker run --name wordpress_container -p 8080:80 --network wordpress -e WORDPRESS_DB_HOST=mysql_container -e WORDPRESS_DB_USER=<dbuser> -e WORDPRESS_DB_PASSWORD=<dbpassword> -e WORDPRESS_DB_NAME=<dbname> -d wordpress

Cleanup

- Remove stopped containers:

docker rm $(docker ps -aq -f status=exited)

- Remove an image:

docker rmi <image_id>

Advanced Exploration

- Decompose a Docker container:

docker export <container_name> -o container.tar
tar -C container_decompressed -xvf container.tar
Portainer

- Launch a Portainer instance:

docker volume create portainer_data
docker run --detach --name portainer -p 9000:9000 -v portainer_data:/data -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer-ce