Cyberworld-builders / ml-blast-breaker

Launching an ML stack on an old gaming machine.
0 stars 0 forks source link

Install Docker #3

Open jaylong255 opened 1 month ago

jaylong255 commented 1 month ago

To install Docker on Ubuntu, you can follow these steps. This guide assumes you're using a relatively recent version of Ubuntu, where Docker installation has been streamlined:

Step-by-Step Guide to Install Docker on Ubuntu:

  1. Update Package Information: Open a terminal and update the package index:

    sudo apt update
  2. Install Required Packages: Install a few prerequisite packages which allow apt to use packages over HTTPS:

    sudo apt install -y ca-certificates curl gnupg lsb-release
  3. Add Docker’s Official GPG Key: Add the GPG key for the official Docker repository:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  4. Set up the Stable Docker Repository: Use the following command to add the stable version of Docker to your system:

    echo \
    "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  5. Update Package Information Again: Update the package index to recognize the new repository:

    sudo apt update
  6. Install Docker Engine: Install the latest version of Docker Engine, Docker CLI, Containerd, and Docker Compose:

    sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
  7. Verify Docker Installation: After installation, you can verify that Docker is installed correctly by checking the version:

    docker --version

    You should see the version of Docker installed.

  8. Start Docker: Docker should start automatically, but if it doesn’t, you can start it with:

    sudo systemctl start docker
  9. Optional - Allow Current User to Run Docker Without sudo: If you want to run Docker commands without typing sudo each time, add your user to the docker group:

    sudo usermod -aG docker $USER

    Note: You'll need to log out and log back in for this change to take effect.

  10. Hello World Test: Run a simple Docker command to make sure everything works:

    docker run hello-world

    This command will download a test image and run it in a container. If you see the message about the container’s Linux OS and the message "Hello from Docker!", you’ve successfully installed Docker.

This process should give you a fully functional Docker environment on Ubuntu. If you encounter any issues, make sure your system is up to date and consider checking Docker's official documentation or forums for any version-specific installation notes or troubleshooting steps.

jaylong255 commented 1 month ago

Docker Compose is already installed by default when you follow the Docker installation steps for Ubuntu, as outlined in my previous response. The command:

sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

installs Docker Compose as well, under the name docker-compose-plugin.

However, if you've installed Docker without Docker Compose or if you want to use a different version of Docker Compose, here's how you can install or update Docker Compose manually:

Manual Installation of Docker Compose

  1. Download Docker Compose: First, find the latest version of Docker Compose you want to install. You can check the latest version from Docker's GitHub releases page for Docker Compose or use the current version known at the time of writing. Here's how to download the latest version (as of my last update, which might not be the current one):

    sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

    Adjust the version number (v2.20.3 in this example) if there's a newer version available.

  2. Apply Executable Permissions: After downloading, make sure the file is executable:

    sudo chmod +x /usr/local/bin/docker-compose
  3. Verify Installation: Check the version of Docker Compose to ensure it was installed correctly:

    docker-compose --version

    This should output the version you've installed.

Notes:

Potential Conflicts:

By following these steps, you should have Docker Compose installed and ready to use on your Ubuntu system, either through the default installation with Docker or by manual setup.

jaylong255 commented 1 month ago

Installing Git on Ubuntu can be done quite straightforwardly via the system's package manager, apt. Here's how you can install Git:

Step-by-Step Guide to Install Git on Ubuntu:

  1. Update Package Index: Open a terminal and update the package list to ensure you're getting the latest versions of software:

    sudo apt update
  2. Install Git: Install Git with the following command:

    sudo apt install -y git

    The -y flag automatically answers "yes" to any prompts, making the installation process non-interactive.

  3. Verify Installation: After installation, verify that Git was installed correctly by checking its version:

    git --version

    This command should output the version of Git you've installed, something like git version 2.30.0.

Additional Configuration (Optional but Recommended):

Using Git:

Now that Git is installed, you can start using it to manage source code or other version-controlled content. Here are some basic commands to get you started:

Remember, while Git is now installed system-wide, these configuration commands (like setting your name and email) only apply to your user account unless you use sudo or run them as root. If you're managing multiple user accounts on your system and each should have their own Git setup, you'll need to run these configuration commands for each user separately.