Skip to main content

linktools container toolkit

Project description

Docker/Pod容器部署工具

开始使用

以基于debain的系统为例配置环境,其他系统请自行安装相应软件,包括Python3, Python3-pip, Git, Docker, Docker Compose

# Install Python3, Python3-pip, Git, Docker, Docker Compose
wget -qO- get.docker.com | bash
sudo apt-get update
sudo apt-get install -y python3 python3-pip git docker-compose-plugin

安装linktools库并添加homelab仓库

# Install linktools library and add repository
python3 -m pip install -U linktools linktools-cntr
ct-cntr repo add https://github.com/ice-black-tea/cntr-homelab  # fetch code from remote repository
ct-cntr repo update                                             # update code from remote repository

容器部署

Nas (主页、Nextcloud、...) 环境部署

👉 搭建文档

Xray Server (websocket + ssl + vless) 环境搭建

👉 搭建文档

Redroid (Redroid、Redroid-Builder) 环境搭建

👉 搭建文档

内置配置

第一次部署时,会要求填写对应容器的配置项,其中部分内置的配置项包括:

参数 类型 默认值 描述
CONTAINER_TYPE str - 可选项
1. docker: 使用root权限docker daemon
2. docker-rootless: 使用rootless模式docker daemon
3. podman: 使用podman
DOCKER_USER str 当前shell用户 部分容器rootless模式的容器以此用户权限运行
DOCKER_HOST str /var/run/docker.sock docker daemon进程的 url
DOCKER_APP_PATH str ~/.linktools/data/container/app 容器数据持久化目录,强烈建议指定到固态硬盘中
DOCKER_APP_DATA_PATH str ~/.linktools/data/container/app_data 不会频繁读写的容器数据持久化目录,可以放在机械硬盘中
DOCKER_USER_DATA_PATH str ~/.linktools/data/container/user_data 重要用户数据目录,强烈推荐指定到nas专用硬盘中
DOCKER_DOWNLOAD_PATH str ~/.linktools/data/container/download 下载数据目录
HOST str 当前局域网ip地址

常用命令

# 每个子命令都可以通过添加-h参数查看帮助
ct-cntr -h

#######################
# 代码仓库相关(支持git链接和本地路径)
#######################

# 添加仓库
ct-cntr repo add https://github.com/ice-black-tea/cntr-homelab 

# 拉去仓库最新代码
ct-cntr repo update

# 删除仓库
ct-cntr repo remove

#######################
# 容器安装列表管理
#######################

# 添加容器
ct-cntr add omv gitlab portainer vscode

# 删除容器
ct-cntr remove omv

#######################
# 容器管理
#######################

# 启动容器
ct-cntr up

# 重启容器
ct-cntr restart

# 停止容器
ct-cntr down

#######################
# 配置管理
#######################

# 查看容器docker配置
ct-cntr config

# 查看相关变量配置
ct-cntr config list

# 修改变量
ct-cntr config set ROOT_DOMAIN=test.com ACME_DNS_API=dns_ali Ali_Key=xxx Ali_Secret=yyy

# 删除变量
ct-cntr config unset ROOT_DOMAIN ACME_DNS_API Ali_Key Ali_Secret

# 使用vim编辑配置文件
ct-cntr config edit --editor vim

# 重新加载配置
ct-cntr config reload 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linktools_cntr-0.0.1rc0.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

linktools_cntr-0.0.1rc0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file linktools_cntr-0.0.1rc0.tar.gz.

File metadata

  • Download URL: linktools_cntr-0.0.1rc0.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.10

File hashes

Hashes for linktools_cntr-0.0.1rc0.tar.gz
Algorithm Hash digest
SHA256 712b822d01a82e3bb7d047b53eef544890be31a3cd47f2865a4109430a190773
MD5 3465f474a8b9363ac5faaff938d92793
BLAKE2b-256 0bcb1a210e99f4bce14b33ad4adbfe7963fce1998fda9ee66146210b26d79816

See more details on using hashes here.

File details

Details for the file linktools_cntr-0.0.1rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for linktools_cntr-0.0.1rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 cebe8f106aca550bb9a24f10a8aa366ba36aecb1180df8072a57dae798132f50
MD5 7cceec4d82ef6a110cc5d56a9f5b90e6
BLAKE2b-256 c0cc698b3d9712117fec3cccf3df4bea2bc4a7e4cc4df3a1d3fbff038fbfa7ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page