Web API to Manage docker instances on remote hosts
cp config.yaml.ori config.yamlFor SSH connexion, please provide the password: password: xxxxxxx Or the private key path: privatekeyfile: mycreds/id_rsa.priv
Note: The password is prioritary over the private key file, if both are provided, the password will be used. For security reasons, it is recommended to use the private key file.
- Add string in
secretofconfig.yamlfile - Convert the string to base64
- Add
?secret=base64stringto the URL to access the API (do not forget to replacebase64stringby the base64 string)
curl "http://localhost:14000/serverlist?secret=QWJjZGVmZ2hpamsxMiQ="["ChallServer01", "ChallServer02"]
pip install -r requirements.txt
./remoteDockersMgr.pycurl http://localhost:14000/serverlist["ChallServer01", "ChallServer02"]
curl "http://localhost:14000/dockerrun?server=ChallServer01&image=nginx:1.25&name=mynginx3&port=80&label=UID%3DUSERID_345642456"ada236a60961765a0bc7d8527de4cec31fa6e70f3b57bf98a2453d14ffb71d17
curl -s http://localhost:14000/dockerps?server=ChallServer01 | jq .curl "http://localhost:14000/dockerdestroy?server=ChallServer01&id=79a836407792ad8af976ebed2dca769de9ec7acd48d55d972aa928aa526c1161"79a836407792ad8af976ebed2dca769de9ec7acd48d55d972aa928aa526c1161
Installer docker, et faire en sorte que les logs n'écrasent pas le disque
cat /etc/docker/daemon.json{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"dns": ["8.8.8.8"]
}Use the same Timezone on all servers
timedatectl set-timezone Europe/Paris ## Replace Europe/Paris by your timezoneSet the time from the internet
timedatectl set-ntp true