In my Dockerfile
, I have the following:
git clone https://github.com/gdraheim/docker-systemctl-replacement /opt/systemctl-github && \
rm /usr/bin/systemctl && \
ln -s /opt/systemctl-github/files/docker/systemctl.py /usr/bin/systemctl && \
ls -lh /usr/bin/systemctl && \
/usr/bin/systemctl stop amazon-ssm-agent && \
However, when the docker container is being built, it complains about not being able to find /usr/bin/systemctl
. The command right before it calls ls
on it, which shows it in the docker build process, so not quite sure I understand why.
Here's what the docker build shows:
Cloning into '/opt/systemctl-github'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed100 29.6M
100 29.6M 0 0 14.1M 0 0:00:02 0:00:02 --:--:-- 14.1M
lrwxrwxrwx 1 root root 47 Dec 12 21:04 /usr/bin/systemctl -> /opt/systemctl-github/files/docker/systemctl.py
/bin/sh: 1: /usr/bin/systemctl: not found
Any idea why this is saying /usr/bin/systemctl
is not found, although ls
shows it right there in the output?