Amazon web services 如何在Docker上设置云托管
全部, 我正在尝试在Fargate上的AWS ECS计划任务上实施云托管解决方案 我的Amazon web services 如何在Docker上设置云托管,amazon-web-services,docker,cloudcustodian,Amazon Web Services,Docker,Cloudcustodian,全部, 我正在尝试在Fargate上的AWS ECS计划任务上实施云托管解决方案 我的Dockerfile看起来像: FROM cloudcustodian/c7n:latest WORKDIR /opt/src COPY policy.yml policy.yml COPY mailer.yml mailer.yml ENTRYPOINT [ "/bin/sh" ] 其中policy.yml看起来像 policies: - name: c7n-mailer-test res
Dockerfile
看起来像:
FROM cloudcustodian/c7n:latest
WORKDIR /opt/src
COPY policy.yml policy.yml
COPY mailer.yml mailer.yml
ENTRYPOINT [ "/bin/sh" ]
其中policy.yml
看起来像
policies:
- name: c7n-mailer-test
resource: sqs
filters:
- "tag:MailerTest": absent
actions:
- type: notify
template: default
priority_header: '2'
subject: testing the c7n mailer
to:
- test@mydomain.com
transport:
type: sqs
queue: arn:aws:iam::xxxx:role/cloud-custodian-mailer-role-svc
queue_url: https://sqs.ap-southeast-1.amazonaws.com/xvxvxvx9/cloud-custodian
role: arn:aws:iam::xxxxx:role/cloud-custodian-mailer-role
from_address: test@mydomain.in
另外,mailer.yml
看起来像
policies:
- name: c7n-mailer-test
resource: sqs
filters:
- "tag:MailerTest": absent
actions:
- type: notify
template: default
priority_header: '2'
subject: testing the c7n mailer
to:
- test@mydomain.com
transport:
type: sqs
queue: arn:aws:iam::xxxx:role/cloud-custodian-mailer-role-svc
queue_url: https://sqs.ap-southeast-1.amazonaws.com/xvxvxvx9/cloud-custodian
role: arn:aws:iam::xxxxx:role/cloud-custodian-mailer-role
from_address: test@mydomain.in
运行图像后,我无法在SQS或收件人的电子邮件中看到任何消息
另外,如何将输出也存储在s3上。docker hub云托管上已经有一个正式的docker映像: 如果您想与保管人一起使用工具,docker hub Ex.Mailer上还提供了单独的docker图像: 但是,如果您想在同一容器中运行这两个组件,请查看以下内容: Dockerfile
FROM python:3.6-alpine
LABEL MAINTAINER="Harsh Manvar <harsh.manvar111@gmail.com>"
WORKDIR /opt/src
COPY cloud-custodian .
RUN apk add --no-cache --virtual .build-deps gcc musl-dev
RUN pip install -r requirements.txt && \
python setup.py install && \
cd tools/c7n_mailer/ && \
pip install -r requirements.txt && \
pip install requests && \
python setup.py install
RUN apk del .build-deps gcc musl-dev
WORKDIR /opt/src
COPY policy.yml policy.yml
COPY mailer.yml mailer.yml
ENTRYPOINT [ "/bin/sh" ]
为什么不单独使用两个容器呢?你可以根据自己的要求来做。我为@cloudbud做了整个演示,但要求是一起运行托管和邮件。可以理解。我想知道使用一个包含这两个工具的定制容器与单独使用每个容器的优缺点是什么。从您的回答来看,唯一的优点似乎是您不必下载两个单独的容器。我认为,与官方容器相比,定制容器的更新周期更长。