gdraheim / docker-systemctl-replacement

docker systemctl replacement - allows to deploy to systemd-controlled containers without starting an actual systemd daemon (e.g. centos7, ubuntu16)
European Union Public License 1.2
1.39k stars 399 forks source link

How is this suppoused to be ussed? #166

Open fcolecumberri opened 1 year ago

fcolecumberri commented 1 year ago

The Readme makes a great work explaining how it works, but I still find some troubles understanding how this should be used. I found this on pypi https://pypi.org/project/docker-systemctl-replacement/ so I would assume I could put inside a dockerfile:

FROM rockylinux
# ...
RUN dnf install -y python39
RUN python3 -m pip install docker-systemctl-replacement
# ...

However it doesn't work, I am almost sure it is not supposed to run that way since I could not find mention on pip in any place on the Readme.

I have also thought I could just:

FROM rockylinux
# ...
RUN dnf install -y python39
COPY ../docker-systemctl-replacement/files/docker/systemctl3.py /usr/bin/systemctl
# ...

However I am not sure if I should only do that of if I should also do something else. I am new to docker.

gdraheim commented 1 year ago

The pip-module installs "systemctl.py" and "systemctl3.py". In order to override "systemctl" command you would need to make the copy/symlink being an additional step in the dockerfile.

After all, you are correct - copy/download the one file and push it in place.