Docker Compose简介

Docker Compose 是用于定义和运行多容器 Docker 应用程序的工具。

通过Compose可以使用yml文件来配置应用程序需要的所有服务。

然后使用命令可以从yml文件配置中创建并启动所有服务。

使用daoCloud下载docker-compose文件

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
100   423  100   423    0     0     71      0  0:00:05  0:00:05 --:--:--   114
100 16.2M  100 16.2M    0     0  2111k      0  0:00:07  0:00:07 --:--:-- 19.3M

下载完成添加可执行命令

sudo chmod +x /usr/local/bin/docker-compose

安装Compose

sudo pip install docker-compose
Collecting docker-compose
  Downloading https://mirrors.aliyun.com/pypi/packages/f3/3e/ca05e486d44e38eb495ca60b8ca526b192071717387346ed1031ecf78966/docker_compose-1.29.2-py2.py3-none-any.whl (114kB)
    100% |████████████████████████████████| 122kB 5.9MB/s 
Collecting distro<2,>=1.5.0 (from docker-compose)
  Downloading https://mirrors.aliyun.com/pypi/packages/b5/7e/ddfbd640ac9a82e60718558a3de7d5988a7d4648385cf00318f60a8b073a/distro-1.7.0.tar.gz (58kB)
    100% |████████████████████████████████| 61kB 44.4MB/s 
  Running setup.py (path:/tmp/pip-build-lZLOeB/distro/setup.py) egg_info for package distro produced metadata for project name unknown. Fix your #egg=distro fragments.
Requirement already satisfied (use --upgrade to upgrade): requests<3,>=2.20.0 in /usr/lib/python2.7/site-packages (from docker-compose)
Collecting dockerpty<1,>=0.4.1 (from docker-compose)
  Downloading https://mirrors.aliyun.com/pypi/packages/8d/ee/e9ecce4c32204a6738e0a5d5883d3413794d7498fe8b06f44becc028d3ba/dockerpty-0.4.1.tar.gz
Collecting docopt<1,>=0.6.1 (from docker-compose)
  Downloading https://mirrors.aliyun.com/pypi/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz
Collecting texttable<2,>=0.9.0 (from docker-compose)
  Downloading https://mirrors.aliyun.com/pypi/packages/75/23/8170868d04b153b1b9ed1bb84348212bb4a08f31b292ef9d7f6ea648fd49/texttable-1.6.4-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): websocket-client<1,>=0.32.0 in /usr/lib/python2.7/site-packages (from docker-compose)
Collecting python-dotenv<1,>=0.13.0 (from docker-compose)
  Downloading https://mirrors.aliyun.com/pypi/packages/87/8d/ab7352188f605e3f663f34692b2ed7457da5985857e9e4c2335cd12fb3c9/python-dotenv-0.21.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-lZLOeB/python-dotenv/setup.py", line 12, in <module>
        long_description = read_files(['README.md', 'CHANGELOG.md'])
      File "/tmp/pip-build-lZLOeB/python-dotenv/setup.py", line 7, in read_files
        with open(file, encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lZLOeB/python-dotenv/
You are using pip version 9.0.1, however version 22.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command
点赞(1) 打赏

Comment list 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部