Skip to content

특정 이름과 유사한 docker container에 동일한 명령어를 수행하는 docker exec command

Notifications You must be signed in to change notification settings

greenbear00/dockercli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DockerCLI

다중 docker container에 동시 명령어를 수행할 수 있는 cli command

사용 가능한 명령어

  • ls : 현재 docker container를 보여줌
  • exec : 지정한 cname(docker container name과 일치한 container)에 cmd(명령어) 를 수행함

개발은 dockerSDK와 python client를 사용하여 Command line application

설치

설치하는 방법은 아래와 같습니다.

# 먼저 pip update
python3 -m pip install --upgrade pip

python3 setup.py bdist_wheel
pip install dist/dockercli-1.0-py3-none-any.whl

# 만약 오류가 생긴다면.
pip install --force-reinstall dist/dockercli-1.0-py3-none-any.whl

dockercli -v
Version 1.0

사용법

$ dockercli --help

$ dockercli ls --help

$ dockercli exec --help

$ dockercli ls                                              
List of current docker containers.
        [airflow-cluster_airflow-worker_2] running
        [airflow-cluster_airflow-worker_3] running
        [airflow-jupyter] running
        [flower] running
        [airflow-cluster_airflow-worker_1] running
        [airflow-webserver] running
        [airflow-triggerer] running
        [airflow-scheduler] running
        [mysql] running
        [redis] running

$ dockercli exec -cname worker -cmd pwd -u root
[airflow-cluster_airflow-worker_2] running
/opt/airflow

====================================================================================================
[airflow-cluster_airflow-worker_3] running
/opt/airflow

====================================================================================================
[airflow-cluster_airflow-worker_1] running
/opt/airflow

====================================================================================================
DONE!

About

특정 이름과 유사한 docker container에 동일한 명령어를 수행하는 docker exec command

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages