Connecting to AWS EC2 instance from Docker SDK for python

0 votes

I have created a free tier EC2 instance for deploying a docker image. I am planning to do it through a python program that uses the Docker SDK for Python. In the documentation of the package, the connection is made to the docker instance using the following code snippet

import 
client = docker.from_env()

How can I specify the details of my AWS EC2 instance here so that I can connect to it directly and do operations such as deploying a new image, listing active containers, etc?

If it is possible to specify the connection parameters such as my username, password, host address, and server location here, how can I do it by creating secrets for these params in the app?

I tried connecting using the syntax mentioned but I couldn't find how to make the connection to a cloud instance.

Dec 13, 2022 in AWS by Ashwini
• 5,430 points
525 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

How to set up a SPF(Sender Policy Framework) for AWS EC2 instance?

Setting up a SPF record is pretty ...READ MORE

answered Aug 16, 2018 in AWS by Archana
• 4,170 points
1,553 views
0 votes
1 answer

How to Pass the VPC ID while creating the Ec2 instance in AWS using Python Boto3

import boto3 ec2 = boto3.resource('ec2') instance = ec2.create_instances( ...READ MORE

answered Jan 29, 2019 in AWS by Priyaj
• 58,100 points
3,457 views
0 votes
2 answers
0 votes
1 answer

AWS ECS Service for Wordpress

If your container needs access to the ...READ MORE

answered Sep 20, 2018 in AWS by Priyaj
• 58,100 points
1,502 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP