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.
Quick Start
-
Clean up Docker (if needed)
Linux/macOS:sudo docker system prune
Windows (PowerShell):docker system prune
-
Download environment files
Go to cocolabhub.com, select your target, and click the zip button to download. -
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
-
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. -
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
- Build images and run containers
docker-compose up --build -d
- Check running containers
docker ps
- Access a container
docker exec -it [container_name] bash
If you encounter issues, refer to the Docker Getting Started Guide.