Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Install Python Docker Module in a Virtual Environment #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MAVRICK-1
Copy link

@MAVRICK-1 MAVRICK-1 commented Jan 27, 2025

Title: Fix: Install Python Docker Module in a Virtual Environment

Description:
This PR addresses the issue of failing to install the Python docker module in an externally managed environment. The issue occurred because direct installation with pip was restricted. To resolve this, a virtual environment is created, and the module is installed within it.

Changes Made:

  1. Added a task to create a Python virtual environment (/opt/dockerenv).
  2. Modified the install docker module for Python task to use the created virtual environment.
  3. Ensured all other related tasks remain functional without additional changes.

Fixes #17

Before Fix (Error Log):
Screenshot from 2025-01-28 03-46-20

The error highlighted the externally-managed-environment restriction, preventing direct pip installations.

After Fix:

  • Successfully installs the Python docker module using a virtual environment.
  • Playbook execution completes without errors.

Testing:

  • Verified on Ubuntu with Python 3.12.
  • Confirmed the hello-world Docker container is created and run successfully as part of the playbook execution.

Branch: fix/python-docker-venv-install

Screenshots:
Screenshot from 2025-01-28 03-53-20

@llpeterson plz review my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error Installing Python Docker Module in Managed Environment
1 participant