英文:
How run `aws s3 sync` during docker compose?
问题
以下是aws s3同步命令的代码片段:
version: '3.8'
services:
amazon-aws-cli-download-test-data:
image: amazon/aws-cli:2.13.0 # <- 今天的最新版本
command:
- s3 sync s3://mybucket/myfolder/ /s3/mybucket/myfolder/ --delete
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
volumes:
- './test-data/s3:/s3'
错误信息:
aws: error: argument command: Invalid choice, valid choices are:
s3
命令是AWS CLI中最古老且肯定存在于所有AWS CLI版本中的命令。出了什么问题?如何在容器启动期间执行一些S3同步操作?
英文:
Here is snippet for aws s3 sync command:
version: '3.8'
services:
amazon-aws-cli-download-test-data:
image: amazon/aws-cli:2.13.0 # <- newest version for today
command:
# | `aws` main command was also tried and error was the same
# \/
# - aws s3 sync s3://mybucket/myfolder/ /s3/mybucket/myfolder/ --delete
- s3 sync s3://mybucket/myfolder/ /s3/mybucket/myfolder/ --delete
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
volumes:
- './test-data/s3:/s3'
The error:
aws: error: argument command: Invalid choice, valid choices are:
The s3
command is the oldest that definitely present in all aws cli's. What is wrong? How execute some s3 syncing during containmer start up?
答案1
得分: 0
更改为:
命令:s3同步 s3://mybucket/myfolder/ /s3/mybucket/myfolder/ --delete
问题已修复。
英文:
Changes to
command: s3 sync s3://mybucket/myfolder/ /s3/mybucket/myfolder/ --delete
fixed the issue
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论