elasticsearch - 如何使用 Azure devops docker-compose 任务推送 docker-compose 服务?
问题描述
我正在尝试使用 docker-compose 构建和推送 ElasticSearch 的图像。我正在使用经典编辑器,但无法将其推送到注册表。
docker-compose up 命令将构建映像并在本地和构建管道主机上运行容器,但使用 -d 选项不会。
我错过了什么?
services:
odfe-node1:
image: amazon/opendistro-for-elasticsearch:1.13.2
container_name: odfe-node1
environment:
- cluster.name=odfe-cluster
- node.name=odfe-node1
- discovery.seed_hosts=odfe-node1
- cluster.initial_master_nodes=odfe-node1
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536 # maximum number of open files for the Elasticsearch user, set to at least 65536 on modern systems
hard: 65536
volumes:
- odfe-data1:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9600:9600 # required for Performance Analyzer
networks:
- odfe-net
kibana:
image: amazon/opendistro-for-elasticsearch-kibana:1.13.2
container_name: odfe-kibana
ports:
- 5601:5601
expose:
- "5601"
environment:
ELASTICSEARCH_URL: https://odfe-node1:9200
ELASTICSEARCH_HOSTS: https://odfe-node1:9200
networks:
- odfe-net
volumes:
odfe-data1:
networks:
odfe-net:
构建管道任务
向上
steps:
- task: DockerCompose@0
displayName: 'up -d'
inputs:
azureSubscription: '***'
azureContainerRegistry: '{"loginServer":"***", "id" : "/subscriptions/***/resourceGroups/***/providers/Microsoft.ContainerRegistry/registries/***"}'
dockerComposeFile: 'docker-compose.yml'
dockerComposeCommand: up
推
steps:
- task: DockerCompose@0
displayName: 'Run a Docker Compose command'
inputs:
azureSubscription: '***'
azureContainerRegistry: '{"loginServer":"***", "id" : "/subscriptions/***/resourceGroups/***/providers/Microsoft.ContainerRegistry/registries/***"}'
dockerComposeCommand: 'push kibana'
解决方案
推荐阅读
- python - 每个文件与文件夹的Python shutil复制选项
- java - 当此 JPA 调用是从 @Async 方法的 catch 块进行时,在 JPA 中使用主键删除单个记录不生效
- google-apps-script - 不同类型数据的不同对齐方式
- javascript - 如何正确地将图像分配给状态和功能?
- c# - 用于处理空字符串的数据注释
- excel - 在 Excel 中优化索引匹配问题的最有效方法
- reactjs - 登录 React 页面显示登录页面只有几分之一秒
- postgresql - How can I retrieve a row by uuid in Postgres database?
- c++ - C++ 中的内存映射流数据
- jquery - 如何判断页面是否一直滚动到一边