Coder Social home page Coder Social logo

Comments (9)

cmh234 avatar cmh234 commented on June 12, 2024 2

I was able to successfully launch the app on AWS Elastic Beanstalk multi containers using this Dockerrun.aws.json

{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [
{
"name": "backend-s",
"image": "YOUR_IMAGE_HERE",
"essential": true,
"memory": 400
},
{
"name": "frontend-s",
"image": "YOUR_IMAGE_HERE",
"essential": true,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80
}
],
"links": [
"backend-s"
],
"memory": 200
}
]
}

from angular2-flask.

ansrivas avatar ansrivas commented on June 12, 2024

Hi, it seems like you are trying to allocate 4096 x 2 ( "memory": 4096 part ) memory for this configuration. Does your instance have this much available?
You can try to start with something smaller like 128 and see if you still get the containers up and running.

from angular2-flask.

cmh234 avatar cmh234 commented on June 12, 2024

I reduced the memory to 100 and got past that error. Now I stuck on this error.

**ECS task stopped due to: Essential container in task exited. (backend-c: CannotPullContainerError: AccessDeniedException: User: arn:aws:sts::016511600475:assumed-role/aws-elasticbeanstalk-ec2-role/i-06b601546dfdcbd58 is not authorized to perform: ecr:GetAuthorizationToken on resource: * status code: 400, request id: 54a14bd8- frontend-c: )

2017-08-19 21:59:23 UTC-0700 | ERROR | Failed to start ECS task: arn:aws:ecs:us-west-2:016511600475:task/6951c326-09b4-4b88-8d8b-c1d2410bf62f is STOPPED.**

from angular2-flask.

ansrivas avatar ansrivas commented on June 12, 2024

Again it seems like an authorization issue:

  1. The image needs to be built and published to the ec2 registry.
  2. If it's available there, do you have a read access to pull the image to your current instance where you are running the containers?

from angular2-flask.

cmh234 avatar cmh234 commented on June 12, 2024

Thank you. I did build the image and successfully tested the containers locally.
I loaded them up to the AWS ec2 registry with Docker push. Verified they are there.
I believe the problem is I need to add this security this action "ecr:GetAuthorizationToken" to the Repository permissions. I cannot find a way to add it through the web interface. for several hours I've tried this technique using AWS ect “http://blog.shippable.com/setting-permissions-on-aws-ec2-ecr-repositories.”

No matter what data I put in the JSON file usr1Policy.json (see attached)
usr1Policy.json.txt

I ALWAYS get this error.
An error occurred (InvalidParameterException) when calling the SetRepositoryPolicy operation: Invalid parameter at 'PolicyText' failed to satisfy constraint: 'Invalid repository policy provided'

Any ideas how I get around this error or any other way to add "ecr:GetAuthorizationToken" to the Repository permissions.

from angular2-flask.

ansrivas avatar ansrivas commented on June 12, 2024

Unfortunately its hard to debug it without logs. The request data for PolicyText doesn't seems to be working.
It would resolve much easier if you check on stack-overflow (put debug logs) as this is very AWS specific issue.

from angular2-flask.

cmh234 avatar cmh234 commented on June 12, 2024

Thank you. I was able to set ecr:GetAuthorizationTokenin in the EB role and on the registry using a different user.

I'm getting this error on container frontend-c

host not found in upstream "backend-s" in /etc/nginx/nginx.conf:12
nginx: [emerg] host not found in upstream "backend-s" in /etc/nginx/nginx.conf:12

Do you know how I correctly define the host for AWS container?

from angular2-flask.

ansrivas avatar ansrivas commented on June 12, 2024

Can you try changing the service name in nginx.conf. Rather than using backend-s change it to backend-c ?

from angular2-flask.

cmh234 avatar cmh234 commented on June 12, 2024

Update: I opened a ticket with AWS support. I will let you know the solution once we get it working.

from angular2-flask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.