semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

installing python modules required by collections in semaphore docker container?

Open amlucent opened this issue 1 year ago • 5 comments

Just wondering how this is recommended?

Especially since pip isnt installed either. For example I need pywinrm for ansible.windows collection.

amlucent avatar Aug 08 '23 00:08 amlucent

Same question here. I'm wondering if this is just an anti-pattern or if there's any trick to accomplish that. Need support for ansible-galaxy collection install hetzner.hcloud and the hcloud-python lib.

ahoiroman avatar Aug 08 '23 20:08 ahoiroman

As a quick fix:

docker exec -it <container_id> sh wget https://bootstrap.pypa.io/get-pip.py python get-pip.py python3 -m pip install ..

benmali avatar Aug 14 '23 06:08 benmali

As a quick fix:

docker exec -it <container_id> sh wget https://bootstrap.pypa.io/get-pip.py python get-pip.py python3 -m pip install ..

Thank you. thats a great solution. I am certain that would work for most and if that is the devs preferred method I suggest perhaps they install it by default as part of the docker container.

For me a solution didnt come fast enough so I abandoned the docker container and migrated it to an LXC container where I had more control to install my dependancies.

amlucent avatar Aug 30 '23 18:08 amlucent

I think the clean way would be to build your own custom image from the semaphore image and use that image.

my dockerfile looks like this: FROM semaphoreui/semaphore:latest USER root RUN apk add --no-cache python3 py3-pip && pip3 install pyvmomi

mariusdill avatar Nov 09 '23 13:11 mariusdill

Related to: https://github.com/ansible-semaphore/semaphore/pull/1498

ansibleguy avatar Jan 31 '24 18:01 ansibleguy