Мой docker -компонентный файл:
version: "2"
services:
app:
build:
# Build an image from the Dockerfile in the current directory
context: .
ports:
- 5000:5000
environment:
PORT: 5000
NODE_ENV: production
И docker -compose.override
version: "2"
networks:
# This special network is configured so that the local metadata
# service can bind to the specific IP address that ECS uses
# in production
credentials_network:
driver: bridge
ipam:
config:
- subnet: "169.254.170.0/24"
gateway: 169.254.170.1
services:
# This container vends credentials to your containers
ecs-local-endpoints:
# The Amazon ECS Local Container Endpoints Docker Image
image: amazon/amazon-ecs-local-container-endpoints
volumes:
# Mount /var/run so we can access docker.sock and talk to Docker
- /var/run:/var/run
# Mount the shared configuration directory, used by the AWS CLI and AWS SDKs
# On Windows, this directory can be found at "%UserProfile%\.aws"
- $HOME/.aws/:/home/.aws/
environment:
# define the home folder; credentials will be read from $HOME/.aws
HOME: "/home"
# You can change which AWS CLI Profile is used
AWS_PROFILE: "default"
networks:
credentials_network:
# This special IP address is recognized by the AWS SDKs and AWS CLI
ipv4_address: "169.254.170.2"
# Here we reference the application container that we are testing
# You can test multiple containers at a time, simply duplicate this section
# and customize it for each container, and give it a unique IP in 'credentials_network'.
app:
logging:
driver: awslogs
options:
awslogs-region: eu-west-3
awslogs-group: sharingmonsterlog
depends_on:
- ecs-local-endpoints
networks:
credentials_network:
ipv4_address: "169.254.170.3"
environment:
AWS_DEFAULT_REGION: "eu-west-3"
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: "/creds"
Я добавил свои учетные данные AWS в свою ма c с помощью команды aws configure и учетные данные правильно хранятся в ~ / .aws / credentials.
Я использую docker 2.2.0.4, docker, составьте 1.25.4 и docker -машина 0.16.2.
Когда я запускаю docker -создать, я получаю следующую ошибку:
ОШИБКА: для скребка Невозможно запустить сервисный скребок: Не удалось инициализировать драйвер ведения журнала : NoCredentialProviders: в цепочке нет действительных поставщиков.
Не рекомендуется. Подробные сообщения см. В aws .Config.CredentialsChainVerboseErrors
ОШИБКА: обнаружены ошибки при запуске проекта.
Мне кажется, это потому, что мне нужно установить учетные данные AWS в демоне Docker, но я не могу понять, как это делается в MacOs High Sierra.