Products | Versions |
---|---|
TIBCO Streaming | 10.6 and later |
I have built and run a local docker image for my Streaming application. How can I transfer and run this image on an AWS EC2 instance?
$ docker stop docker_1stCommit the container's settings, and create a new image (named docker_1st_image):
$ docker commit docker_1st docker_1st_imageSave the image to a zip archive:
$ docker save docker_1st_image | bzip2 > docker_1st_image.bz2Copy the zipped image to your AWS EC2 instance:
$ scp -i YourAwsKeys.pem docker_1st_image.bz2 ec2-user@awshost:/tmp/Connect to the AWS EC2 instance, and install docker (if not already installed):
$ ssh -i YourAwsKeys.pem ec2-user@awshost $ sudo yum install -y dockerNext, verify the copied image archive:
$ md5sum /tmp/docker_1st_image.bz2 ea5eb9d7047d8c4978603d80f30ebf41The returned md5 value should match the value of your local copy of the image.
$ sudo cat /tmp/docker_1st_image.bz2 | sudo docker load ... Loaded image(s): localhost/docker_1st_image:latestFinally, run the image (again, with sudo):
$ sudo docker run -d -p 11000:11000 --name docker_1st localhost/docker_1st_image:latest