Link to home
Start Free TrialLog in
Avatar of coder
coderFlag for Australia

asked on

How to push the application to aws and run with docker

Hi Experts,

   I got a server which runs applications with docker and aws, running from console(putty).  The command to run is as follows:-

docker run --name ts_pull ${ts_environment[@]}  -d  --restart always 1234656458.dkr.ecr.ap-southeast-2.amazonaws.com/harvest-ts:1.0.2 start pull

Open in new window


I can understand 1234656458.dkr.ecr.ap-southeast-2.amazonaws.com/harvest-ts:1.0.2 is from aws.  Can any tell me how this container application is pushed to aws?

From the documentation I found Dockerfile is available, from which the docker image is built.  I don't understand how to push this to aws and run with the docker.

Please throw some light over it.

with many thanks,

Bharath AK
Avatar of David Favor
David Favor
Flag of United States of America image

Sounds like you're using a stock AWS instance, rather than custom.

If you build a custom AWS instance, then you bake in all your Docker code into the instance.

If you use a stock AWS instance, then you root ssh into your AWS instance, using the ssh key AWS returns when instance spins up.

Then always add another ssh key so you always have a known key to access all your instances, so you can throw away the temp key returned from AWS at instance spin up time.

Then pull files you require onto your AWS instance, normally via curl or wget.

Then build your Docker container + spin it up.
Avatar of coder

ASKER

Hi David,

      Thanks for your reply.   Aws instance is ubuntu machine.  I connect to it through putty.  I don't understand  what stock aws instance means.  everything is in the ubuntu machine.   it has postgres database, elastic search, python, wagtail, django, dockers etc.   Harvest-ts is a python application, which is run as cron.  I don't understand how this is pushed into aws as docker container.  Could you please elaborate more or provide me links so that I can learn and understand what you mean.  

With Many thanks,

Bharath AK
Two types of instances.

Custom - you generated it from scratch + you'd know if you did this.

Stock - you use an already existing AWS instance.

If you connect through Putty then you're likely running a root shell.

So you'll just follow one of the many guides to running a Docker container on Ubuntu.

Just think of your AWS instance as a dedicated server running Ubuntu... which it is, although very slow as AWS uses have VMs.

Just go to the Docker site + or where ever you acquired the Docker container config you're using for your application.

https://hub.docker.com/ is a good starting point.
Avatar of coder

ASKER

Hi David,

      Thanks for your reply.

      a) There is a DockerFile in repository to build the image for harvest-ts.  My understanding is  After building the docker image it is pushed to aws?  and docker run pulls the image from aws and runs the container.  This is what i have understood. is this right?  please correct me if i am wrong.  my next question is how to push this image to aws.

    b)  I have another question, harvest -ts is a cron it stops and continues after some time.  if this as docker container, will it stop and start at intervals.

     Please correct me wherever I am wrong.  sorry, I feel I am troubling with more questions I don't have clarity

Thank you so much.

Kind Regards,
Bharath AK
ASKER CERTIFIED SOLUTION
Avatar of Prabhin MP
Prabhin MP
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coder

ASKER

Hi Prabin,

    I have one more doubt, How the cron job harvest:ts runs, cron jobs runs at an interval how this Harvest-ts cron works.  Could you please through some light over it.  will it start and stop frequently

With Many thanks,
Bharath AK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coder

ASKER

Hi All,

     Thank you so much for providing me clarity on this.

With Kind Regards,

Bharath AK