I'm a beginner with microservices and have spent hours on the most tiny painful things of AWS today, would appreciate any expert advice as I suspect the next step is very small but could take me hours to work it out otherwise.
So I deployed a nano instance then ssh
into it. Had to actually redo it to fix the security group but anyway it worked eventually. Used scp
to put my docker image up there per the instructions here, in summary docker save
to make a .tar out of the image locally and docker load
to put it into the system remotely after waiting 15 minutes for scp
to upload. Then typed docker run at the command prompt.
Had resorted to these (linux) terminal measures as over the last 3 days had twice tried and failed to do it from the AWS console, as in it uploaded but wouldn't run.
Now it runs fantastically when I type docker run my_image
and I can see it in there with both the commands docker images
and docker ps -a
!
But the command prompt on my AWS instance is busy while it runs.. if I close the terminal window it will surely die. Now that I know it works there, how can I 'deploy' it, ie let it run and continue to run for a month or until further notice? I think it might need some kind of json file called 'task definition' but don't really know at all what to do next. Can this task definition and all remaining tasks be done from within a terminal logged into the instance?