Skip to content

0.7.8 initial release

Latest
Compare
Choose a tag to compare
@san-ghun san-ghun released this 10 Dec 21:40
5111be9

0.7.8 initial release

Overview

tiny42 is a Python-based tool that provides a consistent Docker environment for C/C++ development, particularly useful for 42 School projects. It allows developers to run Linux-specific tools (like valgrind and strace) on macOS through a seamless Docker interface.

Key Features

  • Automatic Docker environment management
  • Seamless command execution within containers
  • Port forwarding support for web development
  • Goinfre directory support for 42 School computers
  • Built-in development tools (gcc, valgrind, strace, etc.)
  • Workspace isolation and consistency

Configuration

The configuration file is located at ~/.config/tiny42/src/settings.py:

# Workspace configuration
TINY42_WORKSPACE = os.path.join(os.environ['HOME'], 'Projects/42berlin')
TINY42_ECHO_ON_STARTUP = True

# Port forwarding settings
TINY42_PORT_PUBLISHING = False
TINY42_PORT_PUBLISHING_HOST = 8080
TINY42_PORT_PUBLISHING_CONTAINER = 8080

Port Publishing

To enable port forwarding between your host machine and container:

  1. Set TINY42_PORT_PUBLISHING = True
  2. Configure ports:
    • TINY42_PORT_PUBLISHING_HOST: Host machine port
    • TINY42_PORT_PUBLISHING_CONTAINER: Container port

Usage

Basic Commands

# Execute commands in container
tiny42 [command] [args...]

# Examples
tiny42 make re
tiny42 valgrind --leak-check=full ./program
tiny42 gcc -Wall -Wextra -Werror main.c
tiny42 "cd ./webserv ; cat webserv.conf | grep location"

# Open shell in container
tiny42 bash

# Management commands
--init, -i             # Initialize the tiny42 container
--reload, -r           # Rebuild and restart the tiny42 container
--open-docker, -o      # Start Docker daemon if not running
--goinfre-docker, -g   # Setup Docker in goinfre directory (42 School specific)
--help, -h             # Show help message

# Examples with flags
tiny42 --init
tiny42 -r              # Short form for reload

Development Environment

The container includes:

  • Build tools (gcc, make)
  • Debugging tools (valgrind, strace)
  • Git
  • Additional utilities (bat, jq)
  • readline development libraries

Warning

Docker enables you to code and compile your results.
But it CANNOT display graphical projects, such as fract-ol, FdF, so_long, cub3d, miniRT.

Uninstallation

# Move to the cloned directory
cd tiny42

# Execute install script with --uninstall flag
python3 install.py --uninstall

License

This project is licensed under the MIT License.

Acknowledgments

  • Started by forking the repository from Dorker by Scarletsang
  • Originally designed for 42 School's development environment needs
  • Refactored from shell scripts to Python for improved maintainability

Tip

For advanced users who want more customizable and functional Docker usage, such as docker-compose and k8s, I personally recommend checking out OrbStack.