记录docker-compose -f docker-compose.yml --profile minio up -d 启动服务后 使用 docker-compose ps 未查看到启动的服务

docker-compose -f docker-compose.yml --profile minio up -d 命令启动容器后想使用 docker-compose ps 命令查看启动的服务,但是为空,docker ps 却可以看到

在这里插入图片描述

服务确实在运行

在这里插入图片描述

然后查资料 docker-compose psdocker ps 的区别是:docker 显示所有的服务,docker-compose 只显示 docker-compose.yml 文件中声明过的服务,使用命令docker-compose -f docker-compose.yml --profile minio ps 就可以查看到此服务了

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Minio is an open-source object storage server that provides a scalable and secure file storage system, often used as an alternative to Amazon S3. Docker Compose is a tool for defining and running multi-container Docker applications. When you combine Minio with Docker Compose, you can easily set up and manage a Minio instance within a Docker environment. To create a `docker-compose.yml` file for Minio, you'll define the necessary services, networks, and volumes. Here's a basic outline of what a `docker-compose.yml` configuration might look like: ```yaml version: '3' services: minio: image: minio/minio container_name: minio_server ports: - "9000:9000" # HTTP port - "9001:9001" # HTTPS port (optional) environment: MINIO_ACCESS_KEY: your-access-key MINIO_SECRET_KEY: your-secret-key MINIO_ROOT_USER: your-username MINIO_ROOT_PASSWORD: your-password volumes: - ./data/minio:/data networks: - minio-net networks: minio-net: driver: overlay volumes: minio-data: ``` In this example: - `image`: Uses the official Minio Docker image. - `ports`: Maps the container ports to host ports for accessing Minio. - `environment`: Sets up environment variables for authentication and other settings. - `volumes`: Mounts a local directory to persist data within the host machine. - `networks`: Creates a network for the service to communicate within the compose setup. Here are some related questions: 1. What is the purpose of specifying the `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD`? 2. How does mounting a volume ensure data persistence when using Minio in Docker? 3. Can you explain the difference between using `9000` and `9001` ports in the configuration?

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值