Install Compose standalone

On this page you can find instructions on how to install Compose standalone on Linux or Windows Server, from the command line.

On Linux

Compose standalone

Note that Compose standalone uses the -compose syntax instead of the current standard syntax compose.
For example type docker-compose up when using Compose standalone, instead of docker compose up.

  1. To download and install Compose standalone, run

    curl -SL https://github.com/docker/compose/releases/download/v2.29.3/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
    
  2. Apply executable permissions to the standalone binary in the target path for the installation.

  3. Test and execute compose commands using docker-compose.

    Tip

    If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path. For example:

    sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
    

On Windows Server

Follow these instructions if you are running the Docker daemon and client directly on Microsoft Windows Server and want to install Docker Compose.

  1. Run PowerShell as an administrator. When asked if you want to allow this app to make changes to your device, select Yes in order to proceed with the installation.

  2. GitHub now requires TLS1.2. In PowerShell, run the following

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  3. Run the following command to download the latest release of Compose (v2.29.3):

     Start-BitsTransfer -Source "https://github.com/docker/compose/releases/download/v2.29.3/docker-compose-windows-x86_64.exe" -Destination $Env:ProgramFiles\Docker\docker-compose.exe

    Note

    On Windows Server 2019 you can add the Compose executable to $Env:ProgramFiles\Docker. Because this directory is registered in the system PATH, you can run the docker-compose --version command on the subsequent step with no additional configuration.

    To install a different version of Compose, substitute v2.29.3 with the version of Compose you want to use.

  4. Test the installation.

    $ docker-compose.exe version
    Docker Compose version v2.29.3
### DolphinScheduler 使用 Docker Compose 安装指南 #### 准备工作 确保环境已经正确配置并安装了所需的工具。对于 Ubuntu 用户来说,可以通过命令 `sudo apt-get install docker-ce` 来安装最新的 Docker CE 版本[^2]。 为了验证 Docker 和 Docker Compose 是否已成功安装及其具体版本号,可以执行如下命令: ```bash docker-compose -v docker-compose --version ``` 这些命令会显示当前使用的 Docker Compose 的版本信息[^1]。 #### 下载 Docker Compose 可执行文件 如果尚未安装 Docker Compose,则可通过以下方式获取适用于系统的二进制文件: ```bash curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d '"' -f 4)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose ``` 这段脚本自动下载最新发布的稳定版 Docker Compose 并赋予可执行权限[^3]。 #### 获取 DolphinScheduler 配置文件 针对 DolphinScheduler 的部署,官方提供了基于 Docker Compose 的快速启动方案。可以从 GitHub 上拉取特定标签下的镜像来简化这一过程: ```bash docker pull apache/dolphinscheduler-standalone-server:latest ``` 此操作将从 Apache 官方仓库中提取最新版本的单节点模式服务器镜像[^4]。 然而,在实际应用环境中更推荐的做法是从项目源码库克隆完整的 compose 文件集或其他形式的支持多容器编排的服务定义文件(如 YAML),以便于自定义设置和扩展功能模块。 #### 编写或调整 `docker-compose.yml` 创建一个新的名为 `docker-compose.yml` 的文件用于描述所需的服务组件和服务间的关系。下面是一个简单的例子,它假设读者希望构建一个包含 MySQL 数据库支持的基础架构实例: ```yaml version: '3' services: dolphinscheduler: image: apache/dolphinscheduler-standalone-server:latest ports: - "12345:1234" environment: SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF8&autoReconnect=true&serverTimezone=Asia/Shanghai SPRING_DATASOURCE_USERNAME: root SPRING_DATASOURCE_PASSWORD: password depends_on: - db db: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: dolphinscheduler ``` 上述配置指定了两个主要部分——一个是运行 DolphinScheduler 应用程序本身;另一个则是提供给前者作为外部依赖关系存在的数据库实例。注意这里的端口映射、环境变量以及服务间的依赖顺序都应根据实际情况作出适当修改以满足不同场景的需求。 完成以上步骤之后就可以通过 `docker-compose up -d` 命令让整个集群按照指定的方式启动起来,并以后台守护进程的形式持续运作下去。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值