Docker [Deployment 04] Docker Compose download and installation and examples Milvus Docker compose (CPU) usage instructions sharing

1.Compose instructions

Docker Compose is a tool for defining and managing multiple Docker containers, designed to simplify the development, deployment, and management of containerized applications. With Docker Compose, you can use a single configuration file (usually a configuration docker-compose.ymlfile) to describe multiple containers, network settings, storage volumes, etc. involved in your application.

Docker Compose official website installation instructions .

1.1 Overview of installing Docker Compose

Important information :

  • Starting in July 2023, Compose V1 will stop receiving updates. It is also no longer included in new versions of Docker Desktop.
  • Compose V2 is included in all currently supported versions of Docker Desktop. For more information, see Migrating to Compose V2 .
  • Docker's documentation mentions and describes the capabilities of Compose V2.

1.2 Installation scenarios

1.2.1 Scenario one: Install Docker Desktop

The easiest and recommended way to get Docker Compose is to install Docker Desktop. Docker Desktop includes Docker Compose as well as the Docker Engine and Docker CLI, which are prerequisites for Compose.

1.2.2 Scenario two: Install the Compose plugin

If you have installed Docker Engine and Docker CLI, you can install the Compose plug-in through the command line. There are two methods:

  1. Software repository via Docker
  2. Download and install manually

IMPORTANT : Supports Linux only

1.2.3 Scenario three: Install the Compose standalone

You can install Compose stand-alone on Linux or Windows Server.

Warning : This installation scenario is not recommended and is supported for backward compatibility only.

2. Compose download and install

Since offline deployment may be required, download and install it here. Official installation documentation .

2.1 Official website process

2.1.1 To download and install the Compose CLI plugin

DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose

2.1.2 Apply executable permissions to the binary

chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
# install Compose for all users:
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose

2.1.3 Test the installation

docker compose version

2.2 Real process

2.2.1 Download

Manually download the file from the unofficial website docker-compose-linux-x86_64(the free version found from the network disk is v2.2.2not the latest version), then rename it docker-composeand put it directly /usr/bin/in the directory.

2.2.2 Granting enforceable rights

chmod +x /usr/bin/docker-compose

2.2.3 Verify installation

[root@tcloud ~]# docker-compose -v
Docker Compose version v2.2.2

3. Kite Docker compose (CPU)

3.1 Download the YAML file

wget https://github.com/milvus-io/milvus/releases/download/v2.3.0/milvus-standalone-docker-compose.yml -O docker-compose.yml

3.2 Start Milvus

# 启动容器
sudo docker compose up -d
# 查看启动状态
sudo docker compose ps

3.3 Connect to Milvus

docker port milvus-standalone 19530/tcp

3.4 Stop Kite

sudo docker compose down

4.Actual use

4.1 Download yaml file

# 跟官网是一致的
wget https://github.com/milvus-io/milvus/releases/download/v2.3.0/milvus-standalone-docker-compose.yml -O docker-compose.yml

4.2 Start Milvus

Since the installation is not standalone-docker-composebut Compose pluginall startup commands are different:

# 启动容器
docker-compose up -d
# 查看状态
docker-compose ps
NAME                COMMAND                  SERVICE             STATUS              PORTS
milvus-etcd         "etcd -advertise-cli…"   etcd                running             2379-2380/tcp
milvus-minio        "/usr/bin/docker-ent…"   minio               running (healthy)   9000/tcp
milvus-standalone   "/tini -- milvus run…"   standalone          created             0.0.0.0:9091->9091/tcp, 0.0.0.0:19530->19530/tcp, :::9091->9091/tcp, :::19530->19530/tcp

4.3 Connect Milvus

docker port milvus-standalone 19530/tcp
# 输出信息
0.0.0.0:19530
:::19530

4.4 Stop Milvus

docker-compose down

Guess you like

Origin blog.csdn.net/weixin_39168541/article/details/132502740