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

systemctl: command not found #185

Open
aakashjonwal89 opened this issue Dec 2, 2021 · 0 comments
Open

systemctl: command not found #185

aakashjonwal89 opened this issue Dec 2, 2021 · 0 comments

Comments

@aakashjonwal89
Copy link

Hi All,
I am trying to install docker in vyos from using below link
"https://brezular.com/2021/04/01/docker-installation-on-vyos/"

Because i need to use web GUI of Vyos. When I tried to install docker from the script at the end it is giving me error for docker demon.

Error:
sudo: systemctl: command not found
./vyos-docker-install.sh: line 37: systemctl: command not found

UPS, Docker service is not running

Script:
#!/usr/bin/bash

v0.1.0

user=$(id -u)
docker_comp_ver='1.28.5'

Check if running as root

[ "$user" != 0 ] && echo "Run script as root, exiting" && exit 1

Install docker req

echo "deb http://deb.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Add docker repo

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" >> /etc/apt/sources.list
apt-get update

Make persistent var for docker to live between vyos upgrades

mkdir -p /config/user-data/docker
ln -s /config/user-data/docker /var/lib/docker

Install docker and docker-compose

apt-get install -y docker-ce docker-ce-cli containerd.io
curl -L "https://github.com/docker/compose/releases/download/$docker_comp_ver/docker-compose-$(uname -s)-$(uname -m)" -o /config/user-data/docker/docker-compose
chmod +x /config/user-data/docker/docker-compose
ln -s /config/user-data/docker/docker-compose /usr/local/bin/docker-compose

Stop docker service from autostart since we need to start manual AFTER vyos finish with iptables

sudo systemctl disable docker

We can autostart now

echo 'systemctl start docker' >> /config/scripts/vyos-postconfig-bootup.script

After making changes to the firewall you have to run systemctl restart docker

systemctl restart docker

Check if docker service is started

systemctl status docker &>/dev/null; ret_docker="$?"
if [ "$ret_docker" == 0 ]; then
echo -e "\nDocker succesfully installed"
else
echo -e "\nUPS, Docker service is not running"
fi

Can anybody help me to start the docker demon on vyos.

thank you in advance
Aakash Jonwal

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

No branches or pull requests

1 participant