Introduction

Build a consistent environment for development, education, and communication using Docker.

  • Developer: Unified environment, easy version control and deployment.
  • Educator: Identical environment for all students, easy material distribution and hands-on support.
  • Communicator: Consistent setup for study groups and tech discussions.
Reduce environment-related issues and boost collaboration, deployment, and learning efficiency.

Quick Start

  1. Clean up Docker (if needed)
    Linux/macOS: sudo docker system prune
    Windows (PowerShell): docker system prune
  2. Download environment files
    Go to cocolabhub.com, select your target, and click the zip button to download.
  3. Extract and move to folder
    Linux/macOS: unzip docker_files.zip -d docker_folder && cd ./docker_folder
    Windows (PowerShell): Expand-Archive -Path docker_files.zip -DestinationPath docker_folder
    cd docker_folder
  4. Run setup
    Click the setup button on the website, copy the provided command, paste it into your terminal, and run it.
    This will build images and start containers automatically.
  5. Check and access containers
    sudo docker ps
    To access a container:
    sudo docker exec -it [container_name] bash

Writing Dockerfile

Dockerfile defines the container environment.
Be sure to include the git URI so that the source code is automatically downloaded.
As shown in the example below, specify the remote repository address (git URI) clearly in the git clone command.

Example:

FROM python:3.11

# Install basic tools
RUN apt-get update && apt-get install -y \
    git \
    curl \
    wget \
    sudo \
    sqlite3 \
    && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /apps

# Change to your own git URI!
RUN git clone -b main https://github.com/yojulab/learn_RAGs learn_RAGs

WORKDIR /apps/learn_RAGs

RUN python -m pip install --upgrade pip
RUN python -m pip install --no-cache-dir -r ./requirements.txt

RUN rm -rf .git

For detailed Dockerfile instructions, refer to the official Docker documentation.

Writing docker-compose.yml

To manage multiple containers at once, use a docker-compose.yml file.
Here is a basic example.

services:
  devs:
    build:
      context: .
    command: sleep infinity
  # db_mongodb:
  #   image: mongo:7
  #   restart: always
  #   ports:
  #     - 27017:27017
  #   command: mongod --bind_ip 0.0.0.0

For docker-compose options and details, see the official documentation.

Run & Check

  1. Build images and run containers
    docker-compose up --build -d
  2. Check running containers
    docker ps
  3. Access a container
    docker exec -it [container_name] bash

If you encounter issues, refer to the Docker Getting Started Guide.