I'm using a service with GoAws with docker image: pafortin/goaws.
This is my docker-compose
version: '2'
services:
goaws:
container_name: goaws
image: pafortin/goaws
ports:
- 4100:4100
volumes:
- ./app/conf:/conf
The problem is that when I create the queue using this command
aws --endpoint-url http://localhost:4100 sqs create-queue --queue-name test,
I am getting this answer:
{
"QueueUrl": "http://://test"
}
a queue created without host and with double ://
Is this a correct behavior?
Am I doing something wrong?
Related
I am uploading the .yml multicontainer file to EB from the AWS console and everything works fine the fist time, but next time I deploy the same .yml EB start a new mySql database, it seems that doesn't detect the volumes. Any ideas? Thanks!
Here my .yml file:
version: '3.3'
services:
database:
image: mysql:5.7.25
environment:
- MYSQL_ROOT_PASSWORD=testpass
- MYSQL_DATABASE=testdb
container_name: local_database
ports:
- '3306:3306'
volumes:
- './mysql_data:/var/lib/mysql'
nest:
image: rsteercen/nest_local:latest
container_name: nest
command: sh -c "sleep 10 && npm run migrations:run && node dist/src/main"
environment:
- DATABASE_TYPE=mysql
- DATABASE_HOST=local_database
- DATABASE_PORT=3306
- PORT=3000
- DATABASE_USER=root
- DATABASE_PASS=testpass
- DATABASE_NAME=testdb
ports:
- '80:3000'
depends_on:
- database
How is your volume defined?
If you're just using docker-compose, you should define also the volume there, fe. like:
volumes:
db-data:
driver_opts:
lifecycle_policy: AFTER_30_DAYS
and then attach it to the service:
services:
database:
volumes:
- db-data:/mysql
I am trying to deploy an application in Docker running on 64bit Amazon Linux 2. I am using a pipeline, which publishes images to a private repository on Dockerhub. Elastic beanstalk uses docker-compose to run containers, but so far I've had no success in accessing the application. I am not using a dockerrun.aws.json file, as v.3 does not support any container configuration, and as far as I know, it's not needed for docker compose.
My docker-compose file contains several services, one of which is a RabbitMQ message broker.
version: '3.9'
services:
Some.API:
image: ...
container_name: some-api
networks:
- my-network
ports:
- "9002:80"
Another.API:
image: ...
container_name: another-api
networks:
- my-network
ports:
- "9003:80"
rabbitmQ:
image: rabbitmq:3-management-alpine
container_name: rabbit-mq
labels:
NAME: rabbitmq
volumes:
- ./rabbitconfig/rabbitmq-isolated.conf:/etc/rabbitmq/rabbitmq.config
networks:
- my-network
ports:
- "4369:4369"
- "5671:5671"
- "5672:5672"
- "25672:25672"
- "15671:15671"
- "15672:15672"
front-end:
image: ...
container_name: front-end
networks:
- my-network
ports:
- "9001:80"
networks:
my-network:
driver: bridge
Once the current version of the application is successfuly deployed to Beanstalk, I see that there is no successful communication in the bridge network.
In the eb-stdouterr.log I see that there are errors while establishing connection between the apis and the message broker:
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable.
The APIs are .NET Core applications, which use the Beanstalk's environment variables to determine the name of the broker service. In the Configuration/Software/Environment properties section there is a following entry:
RABBIT_HOSTNAME | rabbitmq
which should ensure that the services use a proper host name.
Yet, I get exceptions. Any advice?
It turned out that I needed to reference the automatically generated .env file in docker-compose.yml like so:
front-end:
image: ...
container_name: front-end
networks:
- my-network
ports:
- "9001:80"
env_file: <--- these
- .env <--- 2 lines
for each service. Only after doing this the Environment properties from AWS Beanstalk were passed to the containers.
I am following the AWS tutorial on deploying an ECS application using docker compose.
When I run docker compose up, I only receive the message docker UpdateInProgress User Initiated, but nothing else happens:
[+] Running 0/0
- docker UpdateInProgress User Initiated 0.0s
Previously, this worked fine and all the ECS resources (cluster, task definitions, services, load balancer) had been created.
For some reason, now, this does not work anymore (although I have not changed my docker-compose.yml file).
docker-compose.yml:
version: '3'
services:
postgres:
image: ${AWS_DOCKER_REGISTRY}/postgres
networks:
- my-network
ports:
- "5432:5432"
volumes:
- postgres:/data/postgres
server:
image: ${AWS_DOCKER_REGISTRY}/server
networks:
- my-network
env_file:
- .env
ports:
- "${PORT}:${PORT}"
depends_on:
- postgres
entrypoint: "/server/run.sh"
pgadmin:
image: ${AWS_DOCKER_REGISTRY}/pgadmin
networks:
- my-network
depends_on:
- postgres
volumes:
- pgadmin:/root/.pgadmin
ports:
- "${PGADMIN_PORT:-5050}:${PGADMIN_PORT:-5050}"
networks:
my-network:
#driver: bridge
volumes:
postgres:
pgadmin:
I also switched to the correct Docker context before (docker context use my-aws-context).
And I have updated to the latest version of Docker Desktop for Windows and AWS CLI.
Did someone already have a similar problem?
From the message it appears that you are trying to compose up a stack that is existing already (on AWS) and so it's trying to update the CFN stack. Can you check if this is the case? You have a couple of options if that is what's happening: 1) delete the CFN stack (either in AWS or with docker compose down) or 2) launch the docker compose up with the flag --project-name string (where string is an arbitrary name of your choice). By default compose will use the directory name as the project name so if you compose up twice it will try to work on the same stack.
My team is trying to get a local setup for our project. We are running the same docker-compose file with image localstack/localstack:0.8.10. We are running the same shell script. Our script looks like this...
awslocal sns subscribe \
--topic-arn arn:aws:sns:us-east-1:123456789012:cx-clientcomm-traffic-controller-sent \
--protocol sqs \
--notification-endpoint http://localhost:4576/queue/cx-clientcomm-request-processor-queue
For whatever reason, two of the developers are getting this error. Could not connect to the endpoint URL: http://localhost:4566 for the SQS.
I know this port is used for the latest versions of localstack, but they're running the same image as us.
Any ideas??
It is known issue. You need to add in docker-compose lockalstack image next properties
HOSTNAME_EXTERNAL
hostname: localstack
so original docker-compose will looks like:
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME-localstack}"
image: localstack/localstack
hostname: localstack
networks:
- anynet
ports:
- "4566:4566"
environment:
- SERVICES=sqs,sns
- DEBUG=1
- DOCKER_HOST=unix:///var/run/docker.sock
- HOST_TMP_FOLDER=${TMPDIR}
- HOSTNAME_EXTERNAL=localstack
volumes:
- ./data:/tmp/localstack
- "/var/run/docker.sock:/var/run/docker.sock"
And it will not work if you put localhost to both of properties!!! You need to choose another name. I put localstack for hostname and HOSTNAME_EXTERNAL and it works for me
Context :
I am trying to setup a selenium grid to run my UI tests on CI.CI is Jenkins 2.0 and it runs on AWS ECS.When I create a selenium grid using the docker compose and invoke the tests on my MAC (OS Sierra) , it works perfectly.
When run on the AWS ECS , it shows me an : java.awt.AWTError: Can't connect to X11 window server using '99.0' as the value of the DISPLAY variable.
The test code itself is in a container and using a bridge network I have added the container to the same network as the grid.
The docker compose looks something like this :
version: '3'
services:
chromenode:
image: selenium/node-chrome:3.4.0
volumes:
- /dev/shm:/dev/shm
- /var/run/docker.sock:/var/run/docker.sock
container_name: chromenode
hostname: chromenode
depends_on:
- seleniumhub
ports:
- "5900:5900"
environment:
- "HUB_PORT_4444_TCP_ADDR=seleniumhub"
- "HUB_PORT_4444_TCP_PORT=4444"
networks:
- grid_network
seleniumhub:
image: selenium/hub:3.4.0
ports:
- "4444:4444"
container_name: seleniumhub
hostname: seleniumhub
networks:
- grid_network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
testservice:
build:
context: .
dockerfile: DockerfileTest
networks:
- grid_network
networks:
grid_network:
driver: bridge
Please let me know if more info is required.
unset DISPLAY This helped me to solve the problem
This helps in most cases (e.g. starting application servers or other java based tools) and avoids to modify all that many command lines.
It can also be comfortable to add it to the .bash_profile for a dedicated app-server/tools user.
Can you please try this
- no_proxy=""