{"id":15020038,"url":"https://github.com/hughplay/dockerlab","last_synced_at":"2025-10-24T22:32:25.101Z","repository":{"id":134514039,"uuid":"611065981","full_name":"hughplay/dockerlab","owner":"hughplay","description":":alien: Build a docker container as your workspace.","archived":false,"fork":false,"pushed_at":"2025-01-14T02:20:58.000Z","size":137,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T04:31:45.303Z","etag":null,"topics":["docker","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hughplay.png","metadata":{"files":{"readme":"README.en.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-08T03:01:27.000Z","updated_at":"2025-01-13T10:55:38.000Z","dependencies_parsed_at":"2024-02-20T02:39:57.830Z","dependency_job_id":"52df8ae6-51ef-4860-82b4-f657d515f3e2","html_url":"https://github.com/hughplay/dockerlab","commit_stats":{"total_commits":84,"total_committers":1,"mean_commits":84.0,"dds":0.0,"last_synced_commit":"bf9ec8d86682941cbb6989ffc654e1fe2d7829db"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2Fdockerlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2Fdockerlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2Fdockerlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2Fdockerlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hughplay","download_url":"https://codeload.github.com/hughplay/dockerlab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238043896,"owners_count":19407117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose"],"created_at":"2024-09-24T19:54:30.203Z","updated_at":"2025-10-24T22:32:24.744Z","avatar_url":"https://github.com/hughplay.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align = center\u003e\n\n\n\u003ch1\u003eDockerLab\u003c/h1\u003e\n\n[![Package Building Status](https://img.shields.io/github/actions/workflow/status/hughplay/dockerlab/poetry-publish.yml?label=Package%20Build\u0026style=flat-square)](https://github.com/hughplay/dockerlab/actions)\n[![pypi](https://img.shields.io/pypi/v/dockerlab?color=blue\u0026label=pypi\u0026style=flat-square)](https://pypi.org/project/dockerlab/)\n[![Image Building Status](https://img.shields.io/github/actions/workflow/status/hughplay/dockerlab/images-build.yml?label=Image%20Build\u0026style=flat-square)](https://github.com/hughplay/dockerlab/actions)\n[![](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square\u0026labelColor=gray)](#license)\n[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=flat-square\u0026logo=docker\u0026logoColor=white)](https://docs.docker.com/engine/)\n\n*Build a docker container as your workspace.*\n\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n## Pre-requirements\n\n- [Docker](https://docs.docker.com/engine/install)\n\n\n## Features\n\n- **Easy to use**: Just a few commands to build and start a docker container.\n- **Customizable**: You can customize the docker image and the python packages you want to install in the container.\n- **Reproducible**: You can build the same docker image on different machines. Say bye bye to the [\"It works on my machine\"](https://www.reddit.com/r/ProgrammerHumor/comments/70we66/it_works_on_my_machine/) problem.\n- **Convenient**: We made some convenient setups for you, including tools and functions:\n  - tools: [oh-my-zsh](https://ohmyz.sh/), [docker within docker](https://www.docker.com/blog/docker-can-now-run-within-docker/), [tmux](https://github.com/tmux/tmux/wiki), [lightvim](https://github.com/hughplay/lightvim)\n  - free of permission problems: same uid and gid as the host\n  - reversely mounting $HOME directory from container to host\n    - easy to share `~/.ssh` and `~/.gitconfig`\n    - files will not be lost even if the container is removed, e.g., zsh history, configuration files, model checkpoints, ...\n  - free of port mapping: sharing network with the host\n- **Pre-built Images**: We provide several basic [pre-built images](dockerlab/templates/) for quickly setting up your own workspace environment.\n\n\n## Quick Start\n\n**1. Install dockerlab**\n\nInstall dockerlab with pip:\n\n```bash\npip install dockerlab\n```\n\nOr install the latest version from source:\n\n```bash\npip install git+https://github.com/hughplay/dockerlab.git\n```\n\n\n**2. Setup a dockerlab project**\n\nCreate a new dockerlab project:\n\n```bash\ndockerlab new \u003cproject_name\u003e\n```\n\nOr init a dockerlab environment for the existing project:\n\n```bash\ndockerlab init .\n```\n\nThis will setup a few files and directories, the structure is as follows:\n\n```bash\n.\n├── docker/\n│   ├── Dockerfile\n│   └── misc/\n├── docker-compose.yml\n├── docker.py\n├── Makefile\n└── .gitignore\n```\n\n\n**3. DIY your own workspace environment**\n\nIn general, you only need to modify `docker/Dockerfile` to customize your own workspace environment. Files you may care about:\n\n- `docker/Dockerfile`: The dockerfile for building the docker image.\n- `docker-compose.yml`: The docker-compose file for building the docker container.\n- `docker.py`: The python script for building and starting the container.\n- `Makefile`: Convenient commands based on make.\n\n\nWe have prepared several templates and pre-built docker images for you. You can replace the default `docker/Dockerfile` with the template you like by running the following command:\n\n```bash\ndockerlab use \u003ctemplate_name\u003e\n```\n\nThe available templates can be listed by `dockerlab ls`, and the details of each template can be found in [dockerlab/templates](dockerlab/templates).\n\nBy default, the generated `docker/Dockerfile` will use pre-built docker images if there exists. You can also get the full dockerfile by running the following command:\n\n```bash\ndockerlab use \u003ctemplate_name\u003e --full\n```\n\n**4. Build and start the container**\n\n```bash\nmake init\n```\n\nWhen you first execute the above command, it will ask you to enter information related to the container and store them in `.env`. The example of prompt and the output are as follows:\n\n```bash\n# prompts\nGive a project name [dockerlab]: dockerlab\nCode root to be mounted at /project [.]:\nData root to be mounted at /data [data]:\n`/home/hongxin/code/dockerlab/data` does not exist in your machine. Create? [yes]:\nLog root to be mounted at /log [log]:\n`/home/hongxin/code/dockerlab/log` does not exist in your machine. Create? [yes]:\ndirectory to be mounted to hongxin [./docker/misc/container_home]:\n`/home/hongxin/code/dockerlab/container_home` does not exist in your machine. Create? [yes]:\n\n# output\nYour setting (.env):\n  UID: 1000\n  GID: 1000\n  USER_NAME: hongxin\n  PROJECT: dockerlab\n  CODE_ROOT: .\n  DATA_ROOT: /home/hongxin/code/dockerlab/data\n  LOG_ROOT: /home/hongxin/code/dockerlab/log\n  CONTAINER_HOME: /home/hongxin/code/dockerlab/container_home\n  COMPOSE_PROJECT_NAME: dockerlab_hongxin\n```\n\n**5. Get in the container and start your journey.**\n\n```bash\nmake in\n```\n\n## License\n\nDockerLab is released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughplay%2Fdockerlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhughplay%2Fdockerlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughplay%2Fdockerlab/lists"}